modules/graphics/src/main/java/com/sun/scenario/effect/GaussianShadow.java

Print this page

        

@@ -31,10 +31,12 @@
 import com.sun.javafx.geom.RectBounds;
 import com.sun.javafx.geom.Rectangle;
 import com.sun.javafx.geom.transform.BaseTransform;
 import com.sun.scenario.effect.impl.Renderer;
 import com.sun.scenario.effect.impl.state.GaussianShadowState;
+import com.sun.scenario.effect.impl.state.LinearConvolveKernel;
+import com.sun.scenario.effect.impl.state.LinearConvolveRenderState;
 
 /**
  * A blurred shadow effect using a Gaussian convolution kernel, with a
  * configurable radius and shadow color.  Only the alpha channel of the
  * input is used to create the shadow effect.  The alpha value of each

@@ -108,11 +110,11 @@
         state.setShadowColor(color);
     }
 
 
     @Override
-    Object getState() {
+    LinearConvolveKernel getState() {
         return state;
     }
 
     @Override
     public AccelType getAccelType(FilterContext fctx) {

@@ -356,43 +358,10 @@
         ret.grow(hpad, vpad);
         return ret;
     }
 
     @Override
-    public ImageData filterImageDatas(FilterContext fctx,
-                                      BaseTransform transform,
-                                      Rectangle outputClip,
-                                      ImageData... inputs)
-    {
-        return state.filterImageDatas(this, fctx, transform, outputClip, inputs);
-    }
-
-    @Override
-    public boolean operatesInUserSpace() {
-        return true;
-    }
-
-    @Override
-    protected Rectangle getInputClip(int inputIndex,
-                                     BaseTransform transform,
-                                     Rectangle outputClip)
-    {
-        // A blur needs as much "fringe" data from its input as it creates
-        // around its output so we use the same expansion as is used in the
-        // result bounds.
-        if (outputClip != null) {
-            int hpad = state.getPad(0);
-            int vpad = state.getPad(1);
-            if ((hpad | vpad) != 0) {
-                outputClip = new Rectangle(outputClip);
-                outputClip.grow(hpad, vpad);
-            }
-        }
-        return outputClip;
-    }
-
-    @Override
     public boolean reducesOpaquePixels() {
         return true;
     }
 
     @Override