RFR: 8354191: GTK LaF should use pre-multiplied alpha same as cairo

Sergey Bylokhov serb at openjdk.org
Wed Apr 16 22:06:42 UTC 2025


On Fri, 11 Apr 2025 06:01:32 GMT, Maxim Kartashev <mkartashev at openjdk.org> wrote:

>> src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKEngine.java line 618:
>> 
>>> 616:             int index = transparency - 1;
>>> 617:             if (COLOR_MODELS[index] == null) {
>>> 618:                 COLOR_MODELS[index] = GraphicsEnvironment.getLocalGraphicsEnvironment()
>> 
>> How will it work if the configuration changes at runtime?
>
> There will be an additional pixel conversion effort from the outdated configuration's format to the new actual format when this image is used. In other words, status quo.

You are right - as long as the old and new formats are mostly compatible the impact should be minimal. But in the worst case we might fall back to some slower blits. However with the current DirectColorModel, we are likely to hit optimized paths for most target formats.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24551#discussion_r2047832260


More information about the client-libs-dev mailing list