[OpenJDK 2D-Dev] Request for review: JDK-7159455 : Nimbus scrollbar rendering glitch with xrender enabled on i945GM
Jim Graham
james.graham at oracle.com
Wed Oct 2 21:38:47 UTC 2013
Apologies as this is an old bug, but I just looked at the fix and it
seems to me that it will allow shearing transforms to pass because the
tests are incomplete. The 0or180 flag only tests if the horizontal
lines stay horizontal, but they could shift relative to each other in
increasing Y which means a shear is present. Similar, the 90or270 flags
only verify that vertical lines stay vertical, but allow a shear in X.
Also, there are flags in AffineTransform that can tell you if the
transform is quadrant rotated. A much simpler test would be:
((tx.getType() & NON_RECTANGULAR_TX_FLAGS) == 0)
where:
NON_RECTANGULAR_TX_FLAGS = (AffineTransform.TYPE_GENERAL_ROTATION |
AffineTransform.TYPE_GENERAL_TRANSFORM);
...jim
On 8/29/13 12:19 PM, Clemens Eisserer wrote:
> Hi,
>
> Please review my fix for: JDK-7159455 : Nimbus scrollbar rendering
> glitch with xrender enabled on i945GM
> available at: http://cr.openjdk.java.net/~ceisserer/7159455/webrev.00/
>
> Problem description:
> Because of low coordinate precision on intel 945GM (gen3), nimbus
> scrollbares where rendered with glitches.
>
> Fix description:
> Because Java2D doesn't interpolate image-borders, the xrender pipeline
> has to set sampling outside of source destinations to REPEAT_PAD
> (extend with pixel value at border color) and use a mask. Currently,
> for performance reasons, it uses a smaller mask and scales it, which
> causes glitches on i945GM due to low coordinate precision.
> This is a seperate issue I will work on.
>
> Luckily, those code-paths are not really needed for Nimbus:
> When image-borders are axis aligned, we don't need a mask and can use
> the composite region as "mask".
> The blits generated by Nimbus fall into this category, however the
> logic to detect axis-aligned blits (isMaskOmmitable() in old code) was
> completely broken.
> I moved the detection logic to adjustCompositeBounds(), which also
> calculates the destination composite area size.
> By transforming outline points or the destination area it checks for
> axis alignment.
> I also reordered things a bit, to make it more readable.
>
> Thanks, Clemens
>
> PS: Is it ok to keep the line-width of 120 chars?
>
More information about the 2d-dev
mailing list