RFR: 8252255: Blurry rendering of SwingNode with HiDPI scaling in JavaFX

Prasanta Sadhukhan psadhukhan at openjdk.org
Fri Mar 3 08:15:17 UTC 2023


Refactor-ed Swing interop was calling `JLightweightFrame.notifyDisplayChanged()` with [wrong scale factor](https://github.com/openjdk/jfx/blob/master/modules/javafx.swing/src/main/java/com/sun/javafx/embed/swing/newimpl/SwingNodeInteropN.java#L71-L76) 
as it was passing integer scale and not double so scalefactor of 1.25 is being passed as 1.0 to JLightwieightFrame
Due to this, the `imagebuffer `which is created for lightweight container to paint its content to an offscreen image 
is created with wrong[ width/height ](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/sun/swing/JLightweightFrame.java#L457)
Fix is made to have Swing interop call double version of the method to get correct scale factor and set the imagebuffer properly.

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

Commit messages:
 - 8252255: Blurry rendering of SwingNode with HiDPI scaling in JavaFX

Changes: https://git.openjdk.org/jdk/pull/12848/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12848&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8252255
  Stats: 8 lines in 1 file changed: 7 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/12848.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12848/head:pull/12848

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



More information about the client-libs-dev mailing list