HiDPI in monocle

Jim Graham james.graham at oracle.com
Mon Jun 15 20:29:14 UTC 2015

Screen.getPlatformScale() is the scaling from "FX pixels" to the pixels 
that the platform uses for events and window coordinates. 
Screen.getRenderScale() is the recommended scale for rendering - 
typically "ceil(platformScale)".

There is also Window.getOutputScale() which defaults to 
getPlatformScale().  When rendering a scene we render at the render 
scale and then blit it to the size indicated by the output scale.  When 
"renderscale = ceil(platformScale)", as it does on Windows, we may be 
rendering at 200% for a window that is at 150% on the screen, so the 
rendering happens at an integer pixel scale and then we get the size on 
the screen appropriate for what the Windows UI guidelines suggest.


On 6/15/15 9:37 AM, Johan Vos wrote:
> Hi,
> With the changes introduced in the fix for RT-27960 (
> https://bugs.openjdk.java.net/browse/JDK-8098184), the hidpi support on
> Android is broken.
> As part of the changes in
> http://hg.openjdk.java.net/openjfx/8u-dev/rt/rev/670ed25ed138, we
> introduced a getScale method on NativeScreen, and the result of this method
> was used in the constructor of Screen (See MonocleApplication.java). As an
> example, on a Nexus 5 the getScale() would return 3.0, as the device has
> 1920x1080 physical pixels but we use a Scene with dimensions 640x360.
> I'm not sure how to map this getScale() to the new getPlatformScale() and
> getRenderScale() though?
> - Johan

More information about the openjfx-dev mailing list