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

2021-09-17 Thread Pankaj Bansal
On Fri, 17 Sep 2021 13:00:20 GMT, Thiago Milczarek Sayao  
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


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

2021-09-17 Thread Kevin Rushforth
On Tue, 17 Aug 2021 13:12:41 GMT, Pankaj Bansal  wrote:

>> Thiago Milczarek Sayao has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Change test to manual
>
> The fix works fine and the test passes on all platforms. I have given minor 
> comments about the test.

@pankaj-bansal can you re-review this?

-

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


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

2021-09-17 Thread Kevin Rushforth
On Fri, 17 Sep 2021 13:00:20 GMT, Thiago Milczarek Sayao  
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

Marked as reviewed by kcr (Lead).

-

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


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

2021-09-17 Thread Thiago Milczarek Sayao
> 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

-

Changes:
  - all: https://git.openjdk.java.net/jfx/pull/599/files
  - new: https://git.openjdk.java.net/jfx/pull/599/files/29c6148e..ccbe4708

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jfx&pr=599&range=04
 - incr: https://webrevs.openjdk.java.net/?repo=jfx&pr=599&range=03-04

  Stats: 2 lines in 1 file changed: 2 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jfx/pull/599.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/599/head:pull/599

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


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

2021-09-17 Thread Thiago Milczarek Sayao
On Thu, 16 Sep 2021 21:57:08 GMT, Kevin Rushforth  wrote:

>> Thiago Milczarek Sayao has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Review requests.
>
> modules/javafx.graphics/src/main/native-glass/gtk/glass_dnd.cpp line 916:
> 
>> 914: 
>> 915: if (is_raw_image) {
>> 916: data = (guchar*) 
>> convert_BGRA_to_RGBA((const int*) data, w * 4, h);
> 
> This will leak memory, since the original buffer allocated by the call to 
> `g_try_malloc0` on line 911 is never freed. I recommend something like this:
> 
> 
> guchar* origdata = data;
> data = (guchar*) convert_BGRA_to_RGBA((const int*) origdata, w * 4, 
> h);
> g_free(origdata);

Fixed. I really felt something was missing :)

-

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


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

2021-09-16 Thread Kevin Rushforth
On Fri, 20 Aug 2021 22:22:51 GMT, Thiago Milczarek Sayao  
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:
> 
>   Review requests.

This fix introduces a memory leak, but otherwise looks correct. I verified that 
with gtk3 the new manual test passes with the fix and fails without the fix 
(with gtk2 is passes before and after the fix).

modules/javafx.graphics/src/main/native-glass/gtk/glass_dnd.cpp line 916:

> 914: 
> 915: if (is_raw_image) {
> 916: data = (guchar*) convert_BGRA_to_RGBA((const 
> int*) data, w * 4, h);

This will leak memory, since the original buffer allocated by the call to 
`g_try_malloc0` on line 911 is never freed. I recommend something like this:


guchar* origdata = data;
data = (guchar*) convert_BGRA_to_RGBA((const int*) origdata, w * 4, h);
g_free(origdata);

-

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


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

2021-08-21 Thread Pankaj Bansal
On Fri, 20 Aug 2021 22:22:51 GMT, Thiago Milczarek Sayao  
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:
> 
>   Review requests.

Looks good to me now

-

Marked as reviewed by pbansal (Committer).

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


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

2021-08-20 Thread Thiago Milczarek Sayao
On Tue, 17 Aug 2021 13:10:53 GMT, Pankaj Bansal  wrote:

>> Thiago Milczarek Sayao has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Change test to manual
>
> tests/manual/dnd/DndTestDragViewRawImage.java line 59:
> 
>> 57: });
>> 58: 
>> 59: Label label = new Label("Drag image should match source colors 
>> when dragged");
> 
> Could you please make the instructions a bit more clear?

I tried :)

-

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


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

2021-08-20 Thread Thiago Milczarek Sayao
> 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:

  Review requests.

-

Changes:
  - all: https://git.openjdk.java.net/jfx/pull/599/files
  - new: https://git.openjdk.java.net/jfx/pull/599/files/4509462a..29c6148e

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jfx&pr=599&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jfx&pr=599&range=02-03

  Stats: 5 lines in 1 file changed: 3 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jfx/pull/599.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/599/head:pull/599

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


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

2021-08-17 Thread Pankaj Bansal
On Sun, 15 Aug 2021 21:18:51 GMT, Thiago Milczarek Sayao  
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:
> 
>   Change test to manual

The fix works fine and the test passes on all platforms. I have given minor 
comments about the test.

tests/manual/dnd/DndTestDragViewRawImage.java line 59:

> 57: });
> 58: 
> 59: Label label = new Label("Drag image should match source colors 
> when dragged");

Could you please make the instructions a bit more clear?

tests/manual/dnd/DndTestDragViewRawImage.java line 83:

> 81: return SwingFXUtils.toFXImage(image, null);
> 82: }
> 83: }

There is no newline at the file end

-

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


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

2021-08-15 Thread Thiago Milczarek Sayao
On Sun, 15 Aug 2021 21:18:51 GMT, Thiago Milczarek Sayao  
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:
> 
>   Change test to manual

`gdk_cairo_set_source_pixbuf` is available since gtk 2.8. I can't find the 
minimum gtk version for 2.0.

-

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


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

2021-08-15 Thread Thiago Milczarek Sayao
> 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:

  Change test to manual

-

Changes:
  - all: https://git.openjdk.java.net/jfx/pull/599/files
  - new: https://git.openjdk.java.net/jfx/pull/599/files/5530488c..4509462a

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jfx&pr=599&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jfx&pr=599&range=01-02

  Stats: 254 lines in 2 files changed: 83 ins; 171 del; 0 mod
  Patch: https://git.openjdk.java.net/jfx/pull/599.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/599/head:pull/599

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


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

2021-08-15 Thread Thiago Milczarek Sayao
On Wed, 11 Aug 2021 23:42:47 GMT, Thiago Milczarek Sayao  
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:
> 
>   Provide test

JBS: https://bugs.openjdk.java.net/browse/JDK-8272492
Changed test to manual.

-

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


Re: RFR: 8271398: GTK3 drag view image swaps red and blue color channels

2021-08-15 Thread Pankaj Bansal
On Sun, 15 Aug 2021 16:26:59 GMT, Pankaj Bansal  wrote:

>> Test works on Linux, don't know on other platforms.
>> 
>> `gradlew -PFULL_TEST=true -PUSE_ROBOT=true :systemTests:test --tests 
>> test.robot.javafx.dnd.DndRawImageTest`
>
>> Test works on Linux, don't know on other platforms.
>> 
>> `gradlew -PFULL_TEST=true -PUSE_ROBOT=true :systemTests:test --tests 
>> test.robot.javafx.dnd.DndRawImageTest`
> 
> The fix does solve the issue and looks good to me.
> 
> The test is failing on Windows 10 and Mac 10.15. As Kevin has mentioned in 
> other comment, if the automated test is too complex, you can change the test 
> to manual one and file a new bug for automated test and assign it to me. I 
> will write an automated in future.

> @pankaj-bansal Do you prefer I switch the test to manual or make the current 
> one only for Linux?

I think it would be better to make it manual and create new JBS bug for 
automated test.

-

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


Re: RFR: 8271398: GTK3 drag view image swaps red and blue color channels

2021-08-15 Thread Thiago Milczarek Sayao
On Sun, 15 Aug 2021 16:26:59 GMT, Pankaj Bansal  wrote:

>> Test works on Linux, don't know on other platforms.
>> 
>> `gradlew -PFULL_TEST=true -PUSE_ROBOT=true :systemTests:test --tests 
>> test.robot.javafx.dnd.DndRawImageTest`
>
>> Test works on Linux, don't know on other platforms.
>> 
>> `gradlew -PFULL_TEST=true -PUSE_ROBOT=true :systemTests:test --tests 
>> test.robot.javafx.dnd.DndRawImageTest`
> 
> The fix does solve the issue and looks good to me.
> 
> The test is failing on Windows 10 and Mac 10.15. As Kevin has mentioned in 
> other comment, if the automated test is too complex, you can change the test 
> to manual one and file a new bug for automated test and assign it to me. I 
> will write an automated in future.

@pankaj-bansal Do you prefer I switch the test to manual or make the current 
one only for Linux?

-

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


Re: RFR: 8271398: GTK3 drag view image swaps red and blue color channels

2021-08-15 Thread Pankaj Bansal
On Wed, 11 Aug 2021 23:40:00 GMT, Thiago Milczarek Sayao  
wrote:

> Test works on Linux, don't know on other platforms.
> 
> `gradlew -PFULL_TEST=true -PUSE_ROBOT=true :systemTests:test --tests 
> test.robot.javafx.dnd.DndRawImageTest`

The fix does solve the issue and looks good to me.

The test is failing on Windows 10 and Mac 10.15. As Kevin has mentioned in 
other comment, if the automated test is too complex, you can change the test to 
manual one and file a new bug for automated test and assign it to me. I will 
write an automated in future.

-

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


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

2021-08-11 Thread Thiago Milczarek Sayao
> 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:

  Provide test

-

Changes:
  - all: https://git.openjdk.java.net/jfx/pull/599/files
  - new: https://git.openjdk.java.net/jfx/pull/599/files/de2d8ddc..5530488c

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jfx&pr=599&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jfx&pr=599&range=00-01

  Stats: 171 lines in 1 file changed: 171 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jfx/pull/599.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/599/head:pull/599

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


Re: RFR: 8271398: GTK3 drag view image swaps red and blue color channels

2021-08-11 Thread Thiago Milczarek Sayao
On Fri, 6 Aug 2021 02:18:38 GMT, Thiago Milczarek Sayao  
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

Test works on Linux, don't know on other platforms.

`gradlew -PFULL_TEST=true -PUSE_ROBOT=true :systemTests:test --tests 
test.robot.javafx.dnd.DndRawImageTest`

-

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


Re: RFR: 8271398: GTK3 drag view image swaps red and blue color channels

2021-08-10 Thread Kevin Rushforth




On 8/7/2021 11:56 AM, Pankaj Bansal wrote:

On Fri, 6 Aug 2021 20:44:23 GMT, Thiago Milczarek Sayao  
wrote:


I will look at this. Meanwhile, could you please write an automated system test 
for this?

Sure, I would provide it, but in the past drag and drop tests were not 
possible. Any ideas?

I think it should be possible to write an automated testcase in this case. Find 
center of window, move mouse to the location and do mouse click (without 
release). Then move mouse out of window to some location. Afterwards, get the 
pixel color at mouse location and do mouse release. Looks like it should be 
possible. Please let me know if there is some problem, I will also try to write 
one on my end.


If this does turn out to be too complex, we can file a new JBS issue to 
track adding an automated test. In which case, a manual test could be 
added as part of this PR.


-- Kevin



Re: RFR: 8271398: GTK3 drag view image swaps red and blue color channels

2021-08-07 Thread Pankaj Bansal
On Fri, 6 Aug 2021 20:44:23 GMT, Thiago Milczarek Sayao  
wrote:

> > I will look at this. Meanwhile, could you please write an automated system 
> > test for this?
> 
> Sure, I would provide it, but in the past drag and drop tests were not 
> possible. Any ideas?

I think it should be possible to write an automated testcase in this case. Find 
center of window, move mouse to the location and do mouse click (without 
release). Then move mouse out of window to some location. Afterwards, get the 
pixel color at mouse location and do mouse release. Looks like it should be 
possible. Please let me know if there is some problem, I will also try to write 
one on my end.

-

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


Re: RFR: 8271398: GTK3 drag view image swaps red and blue color channels

2021-08-06 Thread Thiago Milczarek Sayao
On Fri, 6 Aug 2021 05:30:39 GMT, Pankaj Bansal  wrote:

> I will look at this. Meanwhile, could you please write an automated system 
> test for this?

Sure, I would provide it, but in the past drag and drop tests were not 
possible. Any ideas?

-

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


Re: RFR: 8271398: GTK3 drag view image swaps red and blue color channels

2021-08-05 Thread Pankaj Bansal
On Fri, 6 Aug 2021 02:18:38 GMT, Thiago Milczarek Sayao  
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`.
> 
> It simplified the gtk2 `DragView::View::expose` to paint with 
> `gdk_cairo_set_source_pixbuf` (that is available since Gtk 2.8). The  
> existing path seems to be converting again.
> 
> Run the issue sample with `-Djdk.gtk.version=2` to test.

I will look at this. Meanwhile, could you please write an automated system test 
for this?

-

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


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

2021-08-05 Thread Thiago Milczarek Sayao
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`.

It simplified the gtk2 `DragView::View::expose` to paint with 
`gdk_cairo_set_source_pixbuf` (that is available since Gtk 2.8). The  existing 
path seems to be converting again.

Run the issue sample with `-Djdk.gtk.version=2` to test.

-

Commit messages:
 - Fix JDK-8271398
 - Merge branch 'openjdk:master' into master
 - Merge branch 'openjdk:master' into master
 - Merge pull request #18 from openjdk/master
 - Merge pull request #17 from openjdk/master
 - Merge pull request #16 from openjdk/master
 - Merge pull request #15 from openjdk/master
 - Merge pull request #14 from openjdk/master
 - Merge pull request #13 from openjdk/master
 - Merge pull request #12 from openjdk/master
 - ... and 8 more: https://git.openjdk.java.net/jfx/compare/ba61a173...de2d8ddc

Changes: https://git.openjdk.java.net/jfx/pull/599/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jfx&pr=599&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8271398
  Stats: 24 lines in 1 file changed: 5 ins; 18 del; 1 mod
  Patch: https://git.openjdk.java.net/jfx/pull/599.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/599/head:pull/599

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