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

Prasanta Sadhukhan psadhukhan at openjdk.org
Wed Mar 8 06:58:21 UTC 2023


On Fri, 3 Mar 2023 08:07:12 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> 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.
> 
> I guess we could remove the int version of the method (which anyways is deprecated) and cleanup Swing interop code to just utilise the double version, as all platforms we support uses floating scale, but that cleanup can be done separately for another day

This pull request has now been integrated.

Changeset: 09d469e5
Author:    Prasanta Sadhukhan <psadhukhan at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/09d469e5adb235ebe43aee459f40ea324ebceb0f
Stats:     8 lines in 1 file changed: 7 ins; 0 del; 1 mod

8252255: Blurry rendering of SwingNode with HiDPI scaling in JavaFX

Reviewed-by: kcr, aghaisas

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

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



More information about the client-libs-dev mailing list