Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8090038

HiDPI support may read Screen attributes from the wrong threads




      The initial checkin for RT-24009 included 2 references to getting the pixel scaling attribute from the View which are not guaranteed to be executed on the correct thread. For now, there should be no issues, but as the threading work is finalized in 8.0, we will need to make sure these 2 references are correctly directed into code on the right threads:

      - NGNode queries all Screen objects in a static block and records the highest value of pixel scaling in the static variable highestPixelScale. This value is used from 2 places currently. Code in NGNode uses this value to disable the scrolling optimizations since they fail for pixel-scaled screens. Code in NGCanvas uses the value to create a backing store for the canvas that has pixel scaling to match the highest pixel-scaled screen. If the bug in the scrolling optimizations is fixed then the usage from NGNode could be removed, but NGCanvas will likely always have to match the highest pixel-scaled screen present so that it can be moved to any screen on the system and still render at full resolution.

      - ES2SwapChain queries the view of the swap chain to get the current pixel scaling. This query will have to be moved to the correct code at the start of a rendering pulse.


        1. car.png
          3 kB
        2. Test.java
          0.3 kB
        3. Test2.java
          0.2 kB

        Issue Links



              Unassigned Unassigned
              flar Jim Graham
              1 Vote for this issue
              7 Start watching this issue