[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: HiDPI scalefactor
From:       Jim Graham <james.graham () oracle ! com>
Date:       2015-02-26 10:42:49
Message-ID: 54EEF8A9.10807 () oracle ! com
[Download RAW message or body]

Hi Johan,

Can you file a Jira issue for this?

			...jim

On 2/26/15 1:18 AM, Johan Vos wrote:
> Hi,
>
> Another one on HiDPI.
> We had an issue on mobile where clicking a ComboBox showed the items on a
> wrong place on HiDPI devices.
> It turned out that this was due to a mismatch between logical and physical
> screensize. In the ES2SwapChain, the physical width is mainly used (e.g. in
> createGraphics). Hence, I made the AndroidScreen return the physical width
> (i.e. 320 pixels * scaleFactor 3).
>
> However, the getContentX() and getContentY() methods don't do that
> conversion in the case of embedded. When I modify this code like below, and
> take the scaling into account, it works.
>
> Should I create an issue for this, with the attached diff? This is not in
> embedded/mobile specific code, so I want to be extremely careful not to
> break anything.
>
> Thanks,
>
> - Johan
>
>
> diff -r 95ca0933010c
> modules/graphics/src/main/java/com/sun/prism/es2/ES2SwapChain.java
> --- a/modules/graphics/src/main/java/com/sun/prism/es2/ES2SwapChain.java Tue
> Feb 24 13:53:50 2015 +0100
> +++ b/modules/graphics/src/main/java/com/sun/prism/es2/ES2SwapChain.java Thu
> Feb 26 10:06:33 2015 +0100
> @@ -247,7 +247,7 @@
>           // EGL doesn't have a window manager, so we need to ask the window
> for
>           // the x/y offset to use
>           if (PlatformUtil.useEGL()) {
> -            return pState.getWindowX();
> +            return (int)(pState.getWindowX() * pixelScaleFactor);
>           } else {
>               return 0;
>           }
> @@ -257,8 +257,8 @@
>           // EGL doesn't have a window manager, so we need to ask the window
>           // for the x/y offset to use
>           if (PlatformUtil.useEGL()) {
> -            return pState.getScreenHeight() -
> -                   pState.getHeight() - pState.getWindowY();
> +            return (int)((pState.getScreenHeight() -
> +                   pState.getHeight() - pState.getWindowY()) *
> pixelScaleFactor);
>           } else {
>               return 0;
>           }
>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic