[OpenJDK 2D-Dev] Different rounding applied by ProcessPath and ShapeSpanIterator

Clemens Eisserer linuxhippy at gmail.com
Wed Sep 28 13:00:30 UTC 2016


Hi Jim,

> They do operate differently.  They aren't meant to be mixed and matched.

Thanks a lot for the detailed description of the relationship between
SSI and ProcessPath.
I did some further digging as to why the xrender pipeline has issues
with the test attached to the mentioned bug report - because when I
wrote the xrender pipeline the java2d specific code was written with
the OpenGL pipeline used sample - which also mixes SSI with
ProcessPath.

The testcase works fine with D3D/OpenGL, because BufferedRenderPipe
has intrinsics for operations that can be lowered to parallelograms.
As soon as I replace the rectangle with an arc, the OpenGL pipeline
shows alignment issues like xrender. This makes sense, because the
code for draw(SunGraphics2D sg2d, Shape s) and fill(SunGraphics2D
sg2d, Shape s) is quite compareable between xrender and d3d/ogl.

The main culprit seems to be that the test fills with a 3px wide
stroke (-> SSI is used) and later calls draw() with a 1px stroke
(ProcessPath). If the stroke does not change, SSI or ProcessPath are
used consistently for fills and draws - otherwise it can occur that
they are "mixed and matched".

I have to admit I am unsure how to proceed...

Best regards, Clemens



More information about the 2d-dev mailing list