RFR: 8271398: GTK3 drag view image swaps red and blue color channels [v5]

Pankaj Bansal pbansal at openjdk.java.net
Fri Sep 17 14:15:48 UTC 2021


On Fri, 17 Sep 2021 13:00:20 GMT, Thiago Milczarek Sayao <tsayao at openjdk.org> wrote:

>> It seems raw images need to be converted BRGA -> RGBA.
>> 
>> It was being converted on gtk2 code path, but gtk3 only uses `gtk_drag_set_icon_pixbuf`.
>> 
>> I have simplified the gtk2 `DragView::View::expose` to paint with `gdk_cairo_set_source_pixbuf` (that is available since Gtk 2.8) because the old way was somehow converting  again.
>> 
>> Run the issue sample with `-Djdk.gtk.version=2` to test the gtk2 code path.
>> 
>> To test:
>> 
>> `./gradlew apps`
>> 
>> 
>> java @build/run.args -cp apps/toys/DragDrop/dist/DragDrop.jar dragdrop.DragDropWithControls
>> java @build/run.args -cp apps/toys/DragDrop/dist/DragDrop.jar dragdrop.DragDropColor 
>> 
>> java -Djdk.gtk.version=2 @build/run.args -cp apps/toys/DragDrop/dist/DragDrop.jar dragdrop.DragDropWithControls
>> java -Djdk.gtk.version=2 @build/run.args -cp apps/toys/DragDrop/dist/DragDrop.jar dragdrop.DragDropColor
>
> Thiago Milczarek Sayao has updated the pull request incrementally with one additional commit since the last revision:
> 
>   - Fix leak

Looks good to me. I re-tested the test with both gtk2 and gtk3 and it the issue is fixed.

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

Marked as reviewed by pbansal (Committer).

PR: https://git.openjdk.java.net/jfx/pull/599


More information about the openjfx-dev mailing list