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

Print this page

        

*** 30,39 **** --- 30,40 ---- import com.sun.javafx.geom.DirtyRegionContainer; import com.sun.javafx.geom.DirtyRegionPool; import com.sun.javafx.geom.Rectangle; import com.sun.javafx.geom.RectBounds; import com.sun.javafx.geom.transform.BaseTransform; + import com.sun.scenario.effect.impl.state.RenderState; /** * An effect that shifts each pixel according to an (x,y) distance from * the (red,green) channels of a map image, respectively. */
*** 243,257 **** public void setWrap(boolean wrap) { boolean old = this.wrap; this.wrap = wrap; } - @Override - public boolean operatesInUserSpace() { - return true; - } - /** * Transform the specified point {@code p} from the coordinate space * of the primary content input to the coordinate space of the effect * output. * In essence, this method asks the question "Which output coordinate --- 244,253 ----
*** 321,348 **** @Override public ImageData filterImageDatas(FilterContext fctx, BaseTransform transform, Rectangle outputClip, ImageData... inputs) { // NOTE: The floatmap is mapped to the entire output bounds so // we need to use unclipped math in the peers to get the // texture mapping right. ! return super.filterImageDatas(fctx, transform, null, inputs); } - @Override ! protected Rectangle getInputClip(int inputIndex, BaseTransform transform, ! Rectangle outputClip) { ! // NOTE: Scan the map and calculate all possible input points // that might contribute to the clipped output? Until then, any // pixel in the output could come from any pixel in the input so // we will need the full input bounds to proceed... ! return null; } @Override public boolean reducesOpaquePixels() { return true; --- 317,346 ---- @Override public ImageData filterImageDatas(FilterContext fctx, BaseTransform transform, Rectangle outputClip, + RenderState rstate, ImageData... inputs) { // NOTE: The floatmap is mapped to the entire output bounds so // we need to use unclipped math in the peers to get the // texture mapping right. ! return super.filterImageDatas(fctx, transform, null, rstate, inputs); } @Override ! public RenderState getRenderState(FilterContext fctx, BaseTransform transform, ! Rectangle outputClip, ! Object renderHelper, ! Effect defaultInput) { ! // NOTE: We could scan the map and calculate all possible input points // that might contribute to the clipped output? Until then, any // pixel in the output could come from any pixel in the input so // we will need the full input bounds to proceed... ! return RenderState.UnclippedUserSpaceRenderState; } @Override public boolean reducesOpaquePixels() { return true;