<AWT Dev> RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL

Alexey Ushakov avu at openjdk.java.net
Thu Jun 3 19:00:57 UTC 2021


On Thu, 3 Jun 2021 18:40:25 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

> > AFAIK, we don't have any control over composing the layer content on top of the window surface. We just get drawable for the layer that has a texture attached and then blits our content into it.
> 
> Probably I missed your point, but there is no issue if we draw opaque color to the layer. Since it does not matter what kind of blending is used when we blit layer to nswindow and the layer has an opaque color. Why we cannot emulate the same when the app draws some transparency and use some blending? Just fill the layer with the opaque "default" color(or make it "opaque"), blend the transparent color on top of it and then blit this opaque result to the window.
> 
> Its is actually a question why the mtl layer is initialised as opaque=false in all cases.

Yes, this approach (make MTLLayer opaque) works for this particular test but it causes artifacts in SwingSet demo. It prevents me from implementing the fix that way. Probably, there is another rendering problem that is masked by making the layer transparent.

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

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


More information about the awt-dev mailing list