[OpenJDK 2D-Dev] [9] Review Request: 8041439: Clipping doesn't work on JPanel after setXORMode method call.

mikhail cherkasov mikhail.cherkasov at oracle.com
Thu May 29 16:29:38 UTC 2014

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:
colorViaShape and colorViaPgram has type PixelToShapeLoopConverter that 
marker interface LoopBasedPipe:
and SurfaceData passes  LoopPipe to constructor of 
as result we don't get to SpanShapeRenderer.

Now we have the following call chain: PixelToShapeConverter -> LoopPipe 
-> SunGraphics2D.loops.fillPathLoop .FillPath
But native method FillPath doesn't support complex clipping.

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


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.

More information about the 2d-dev mailing list