[OpenJDK 2D-Dev] RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL

Sergey Bylokhov serb at openjdk.java.net
Mon Aug 2 21:56:32 UTC 2021


On Mon, 2 Aug 2021 20:04:43 GMT, Alexey Ushakov <avu at openjdk.org> wrote:

>> src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java line 199:
>> 
>>> 197: 
>>> 198:         platformWindow.initialize(target, this, ownerDelegate);
>>> 199:         platformWindow.setOpaque(!isTranslucent());
>> 
>> !isTranslucent() uses the opaque flag which will be initialised in the code below(see setOpaque(getTarget().isOpaque());)
>
> Yes, and we need this call here to initialise content view with correct default value
> CPlatformWindow.java:931 contentView.setWindowLayerOpaque(isOpaque);

I need to look at it closely, I do not understand why we made the native layer opaque=NO by default while the java code uses opaque=true by default. And then we reset the native code from NO to yes by the code above. Why we cannot make both native/java use true/YES and when necessary it will be reset to false/NO by the existing code(via LWWindowPeer.setOpaque() and LWWindowPeer.updateOpaque?)
BTW Probably implementation of LWWindowPeer.setTextured() should call the updateOpaque() as well.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4946


More information about the 2d-dev mailing list