Sure Andrew:

The problem is that to render complex clipping we need to use PixelToShapeConverter with SpanShapeRenderer. But in case of XOR composition, SurfaceData uses colorViaShape or colorViaPgram converter:
http://tvp129231.uk.oracle.com:8080/source/xref/jdk9-dev/jdk/src/share/classes/sun/java2d/SurfaceData.java#568
colorViaShape and colorViaPgram has type PixelToShapeLoopConverter that implements
marker interface LoopBasedPipe:
http://tvp129231.uk.oracle.com:8080/source/xref/jdk9-dev/jdk/src/share/classes/sun/java2d/SurfaceData.java#407
and SurfaceData passes LoopPipe to constructor of PixelToShapeLoopConverter
http://tvp129231.uk.oracle.com:8080/source/xref/jdk9-dev/jdk/src/share/classes/sun/java2d/SurfaceData.java#457
http://tvp129231.uk.oracle.com:8080/source/xref/jdk9-dev/jdk/src/share/classes/sun/java2d/SurfaceData.java#colorPrimitives
as result we don't get to SpanShapeRenderer.

Now we have the following call chain: PixelToShapeConverter -> LoopPipe -> SunGraphics2D.loops.fillPathLoop .FillPath
http://tvp129231.uk.oracle.com:8080/source/xref/jdk9-dev/jdk/src/share/classes/sun/java2d/pipe/LoopPipe.java#308
But native method FillPath doesn't support complex clipping.

That's why I replaced converter(PixelToShapeLoopConverter(LoopPipe)) with paintViaShape(PixelToShapeConverter(SpanShapeRenderer)).

Thanks,
Mikhail.


On 5/29/2014 4:12 PM, Andrew Brygin wrote:
Hello Mikhail,

 could you please provide a bit more detailed explanation for your fix?

Thanks,
Andrew

On 5/29/2014 3:35 PM, mikhail cherkasov wrote:
Hello,

Please review the fix for jdk 9:
http://cr.openjdk.java.net/~mcherkas/8041439/9/webrev.00/
the bug:
https://bugs.openjdk.java.net/browse/JDK-8041439

SurfaceData uses wrong pipe in case of complex clipping shape as result clipping doesn't work
if we use xor color composition and double buffering.

Thanks,
Mikhail.


Reply via email to