<AWT Dev> RFR: 8235153 [TESTBUG] [macos 10.15] java/awt/Graphics/DrawImageBG/SystemBgColorTest.java fails

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Mon Mar 2 09:22:47 UTC 2020


Hello.
Please review the fix for jdk/client.

Bug: https://bugs.openjdk.java.net/browse/JDK-8235153
Fix: http://cr.openjdk.java.net/~serb/8235153/webrev.00

This test have an assumption that java.awt.SystemColor contains
only opaque colors, and this is the reason why it fails on macOS
where some colors have alpha.

The test calls DST.drawImage(src, x,x,BG_Color,null) and assumes that the
background of the image will be exactly the same BG_Color.

- If the DST image and BG_Color both have alpha then we will get a mix of
   them since AlphaComposite.SrcOver is used by default, fixed by the "Src" mode:
   g.setComposite(AlphaComposite.Src)

- If the DST image does not have alpha and BG_Color has it, then we need to
   drop alpha from the BG_Color to properly compare to the background color of DST.

I have checked that an updated test still fails on JDK where initial bug was not fixed.

-- 
Best regards, Sergey.


More information about the awt-dev mailing list