<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 19:41:59 UTC 2020


On 3/2/20 4:14 am, Alexey Ivanov wrote:
> Shall this bug id — 8235153 — be added to the @bug in the test?

That field is for product bugs which could be verified by this test.
Or for test updates when some new assertions are added to the test to cover
some other product code.

> 
> On 02/03/2020 09:22, Sergey Bylokhov wrote:
>> 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