         displayObject.transform.matrix3D = oldMat3D;
 
         return snapshot; 
-    }
-
-    /**
-     *  @private
-     *  Enables clipping, alpha or luminosity, depending on the 
-     *  type of mask being applied.
-     */
-    mx_internal function applyMaskType():void
-    {
-        if (_mask)
-        {
-            if (_maskType == MaskType.CLIP)
-            {
-                // Turn off caching on mask
-                _mask.cacheAsBitmap = false;
-                // Save the original filters and clear the filters property
-                //originalMaskFilters = _mask.filters;
-                _mask.filters = [];
-            }
-            else if (_maskType == MaskType.ALPHA)
-            {
-                _mask.cacheAsBitmap = true;
-                //notifyElementLayerChanged(); // Trigger recreation of the layers
-                drawnDisplayObject.cacheAsBitmap = true;
-            }
-            else if (_maskType == MaskType.LUMINOSITY)
-            {
-                _mask.cacheAsBitmap = true;
-                drawnDisplayObject.cacheAsBitmap = true;
-                
-                // Create the shader wrapper class which wraps the pixel bender filter 
-                var luminosityMaskShader:LuminosityMaskShader = new LuminosityMaskShader();
-                
-                // Sets up the shader's mode property based on 
-                // whether the luminosityClip and 
-                // luminosityInvert properties are on or off. 
-                luminosityMaskShader.mode = calculateLuminositySettings(); 
-                
-                // Create the shader filter 
-                var shaderFilter:ShaderFilter = new ShaderFilter(luminosityMaskShader);
-                
-                // Apply the shader filter to the mask
-                _mask.filters = [shaderFilter];
-            }
-        }
-    }
-    
-    /**
-     *  @private
-     *  Calculates the luminosity mask shader's mode property which 
-     *  determines how the shader is drawn. 
-     */
-    private function calculateLuminositySettings():int
-    {
-        var mode:int = 0;
-        if (luminosityInvert)
-            mode += 1; 
-        if (luminosityClip) 
-            mode += 2;  
-        return mode; 
     }
 
     /**

import spark.core.DisplayObjectSharingMode;
import spark.core.IGraphicElement;
import spark.core.MaskType;

use namespace mx_internal;


                    // and maskee to displayObject. 
                    if (!_mask.parent)
                    {
                        MaskUtil.applyMask(_mask, parent);
                        
                        // Parent after applying the mask since it won't do
                        // anything if there is a parent.
                        Sprite(displayObject).addChild(_mask);  
                        
                        if (!_drawnDisplayObject)
                        {
