--- old/modules/graphics/src/main/java/com/sun/scenario/effect/BoxBlur.java 2014-02-21 17:01:58.000000000 -0800 +++ new/modules/graphics/src/main/java/com/sun/scenario/effect/BoxBlur.java 2014-02-21 17:01:58.000000000 -0800 @@ -33,13 +33,14 @@ import com.sun.javafx.geom.transform.BaseTransform; import com.sun.scenario.effect.impl.Renderer; import com.sun.scenario.effect.impl.state.BoxBlurState; +import com.sun.scenario.effect.impl.state.LinearConvolveKernel; /** * A blur effect using a box-shaped convolution kernel, with a configurable * size for each dimension of the kernel and a number of passes to control * the quality of the blur. */ -public class BoxBlur extends CoreEffect { +public class BoxBlur extends LinearConvolveCoreEffect { private final BoxBlurState state = new BoxBlurState(); @@ -54,7 +55,7 @@ * */ public BoxBlur() { - this(1, 1); + this(1.0f, 1.0f); } /** @@ -72,7 +73,7 @@ * @throws IllegalArgumentException if either {@code hsize} * or {@code vsize} is outside the allowable range */ - public BoxBlur(int hsize, int vsize) { + public BoxBlur(float hsize, float vsize) { this(hsize, vsize, 1, DefaultInput); } @@ -93,7 +94,7 @@ * or {@code vsize} or {@code passes} * is outside the allowable range */ - public BoxBlur(int hsize, int vsize, int passes) { + public BoxBlur(float hsize, float vsize, int passes) { this(hsize, vsize, passes, DefaultInput); } @@ -111,7 +112,7 @@ * or {@code vsize} or {@code passes} * is outside the allowable range */ - public BoxBlur(int hsize, int vsize, int passes, Effect input) { + public BoxBlur(float hsize, float vsize, int passes, Effect input) { super(input); setHorizontalSize(hsize); setVerticalSize(vsize); @@ -119,7 +120,7 @@ } @Override - Object getState() { + LinearConvolveKernel getState() { return state; } @@ -149,7 +150,7 @@ * * @return the horizontal size of the effect kernel */ - public int getHorizontalSize() { + public float getHorizontalSize() { return state.getHsize(); } @@ -166,8 +167,7 @@ * @throws IllegalArgumentException if {@code hsize} * is outside the allowable range */ - public void setHorizontalSize(int hsize) { - int old = state.getHsize(); + public final void setHorizontalSize(float hsize) { state.setHsize(hsize); } @@ -176,7 +176,7 @@ * * @return the vertical size of the effect kernel */ - public int getVerticalSize() { + public float getVerticalSize() { return state.getVsize(); } @@ -193,8 +193,7 @@ * @throws IllegalArgumentException if {@code vsize} * is outside the allowable range */ - public void setVerticalSize(int vsize) { - int old = state.getVsize(); + public final void setVerticalSize(float vsize) { state.setVsize(vsize); } @@ -224,8 +223,7 @@ * @throws IllegalArgumentException if {@code passes} is outside the * allowable range */ - public void setPasses(int passes) { - int old = state.getBlurPasses(); + public final void setPasses(int passes) { state.setBlurPasses(passes); } @@ -257,39 +255,6 @@ } @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 hgrow = state.getKernelSize(0) / 2; - int vgrow = state.getKernelSize(1) / 2; - if ((hgrow | vgrow) != 0) { - outputClip = new Rectangle(outputClip); - outputClip.grow(hgrow, vgrow); - } - } - return outputClip; - } - - @Override public boolean reducesOpaquePixels() { if (!state.isNop()) { return true;