The logic here has mixed up the opacities and what needs to be done about them.

If the source image is opaque, then this is not a BG operation at all because the bg color would not show through an opaque image, so checking the srcData is both wrong and should be a NOP here. If we get into that block with a srcData that is opaque then something has gone wrong somewhere else. In particular, isBgOp should have returned false in that case.

The transparency that matters is when the bg color has transparency and that is not what is being tested here. The test for xRGB and ARGB should be using the bg color...

                        ...jim

On 3/2/16 5:17 AM, Jayathirth D V wrote:
Hi,

I have updated the changes to select proper Buffer Image type based on
source transparency and not just using ARGB directly.

Please find the updated webrev for review:

http://cr.openjdk.java.net/~jdv/8139183/webrev.01/

Thanks,

Jay

*From:* Jayathirth D V
*Sent:* Wednesday, March 02, 2016 5:02 PM
*To:* 2d-dev@openjdk.java.net; Philip Race; Prasanta Sadhukhan
*Subject:* Review Request for JDK-8139183 : drawImage misses
background's alpha channel

Hi,

_Please review the following fix in JDK9:_

__

Bug : https://bugs.openjdk.java.net/browse/JDK-8139183

Webrev : http://cr.openjdk.java.net/~jdv/8139183/webrev.00/

Issue : When we scale any buffered image using drawImage() API which
takes scale coordinates we are losing alpha channel in background color.

Root cause : We are creating opaque temporary image when we have
background color and scale is happening in renderImageXform() API of
DrawImage.java. By making it opaque we are losing translucency.

Solution : Instead of creating opaque RGB temporary image use ARGB
temporary image to maintain translucency of image.

Thanks,

Jay

Reply via email to