[OpenJDK 2D-Dev] Fix suggestion: Black boxes arround glyphs with SrcIn and Src/SrcIn+EA [OGL, D3D]

Clemens Eisserer linuxhippy at gmail.com
Thu Oct 3 15:12:14 UTC 2013


Please review my fix-suggestion for the problem described below
available at: http://cr.openjdk.java.net/~ceisserer/fix11/webrev.03/
A testcase is available at:

Problem description:
When rendering Text with AlphaComposite.SrcIn and Src/SrcIn with EA,
the accelerated D3D/OGL pipelines render black boxes arround
individual glyphs.
As far as I can see, this is caused by an invalid check during
pipeline validation:

/* CompositeType.SrcNoEa (any color) */
-            (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY &&
-             sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR)

>From my understanding the check should allow for using the accelerated
text pipeline for AlphaComposite.SRC when a color is used as source.
However, as is the check also accepts the composition rules CLEAR,
SRC, SRCIN regardless of extra alpha.

Fix description:
The fix makes the check strikter to explicitly check for
comp-rule==Src and the currently set extra-alpha == 1.
It only fixes the issue for the OpenGL pipeline, but the changes
should apply 1:1 for the D3D pipeline.

Thanks, Clemens

More information about the 2d-dev mailing list