The current implementation of screen capture with ScreenCast has some 
shortcomings in handling ui scale.

This changeset includes:

* sun.java2d.uiScale value is now taken into account
* screen data streams from ScreenCast are provided in native screen resolution 
regardless of the scale set in the system.
Now we take that into account and resize the image accordingly.
* We are now trying all available `restore_token`, since it is is tied to the 
display, but not to its resolution.
* Skips the gtk2 part of the ScreenCaptureGtkTest as it is not supported.

Following tests are no longer failing on Wayland:
java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java
java/awt/Robot/HiDPIScreenCapture/ScreenCaptureGtkTest.java
java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java

Other testing also looks good, including manual testing with various scales set 
in the system(including fractional scaling).

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

Commit messages:
 - initial

Changes: https://git.openjdk.org/jdk/pull/16027/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16027&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8309621
  Stats: 235 lines in 8 files changed: 168 ins; 48 del; 19 mod
  Patch: https://git.openjdk.org/jdk/pull/16027.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16027/head:pull/16027

PR: https://git.openjdk.org/jdk/pull/16027

Reply via email to