[OpenJDK 2D-Dev] [9] Review Request: JDK-8165212 VolatileImage should not be compatible with GraphicsConfiguration which transform is changed

Prahalad Kumar Narayanan prahalad.kumar.narayanan at oracle.com
Fri Oct 14 10:38:09 UTC 2016

Hello Everyone


Good day to you.


Request your time in reviewing the fix for-

      Bug : JDK-8165212

      Title : VolatileImage should not be compatible with GraphicsConfiguration which transform is changed


Description on the bug-

       . As per the bug, Volatile Image's graphics configuration is not updated when the host machine display's DPI is changed at runtime (while still running the java app). In addition, the method contentsLost() does not return true when display's DPI is modified.

       . It is important to note that, the issue is not reproducible with D3D/OpenGL backend. It is reproducible with non-accelerated Volatile Image.


Root Cause

       . A callback method- displayChanged() in VolatileSurfaceManager.java is invoked when display's settings (DPI) is modified.

       . The callback method, currently, updates the graphics configuration only for Accelerated volatile image. Graphics configuration is not updated for non-accelerated system memory based VolatileImage.

       . Until recently, there wasn't any need for updating graphics configuration for non-accelerated volatileImage. However, Win 8.1 and above provide feature to dynamically update the DPI setting (without requiring for log-off/ log-in), which causes the current bug.


Bug Fix

      . First, the callback method is modified to update graphics configuration for non-accelerated volatile image also.

      . An update to graphics configuration might require re-creation of the surface. Especially, when the scale factor is increased. Hence the system memory based backupSurface is re-created here.

      . The above change is followed by change to Validate() API, so that the backup surface re-creation in displayChanged() method, correctly returns IMAGE_RESTORED from validate() API. This way, the code flow for non-accelerated Volatile Images behaves just the same way as accelerated volatile images.

       . Approximately 81 Jtreg test cases (that contained VolatileImage) were run on win7, linux, and osx. No new regressions have been found after the modification.

       . In addition, a manual test case has been provided to ensure the proper functioning of the fix


Kindly review the changes and provide your suggestions

Review link: http://cr.openjdk.java.net/~pnarayanan/8165212/webrev.00/


Thank you for your time in review

Have a good day


Prahalad N.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20161014/1e362375/attachment.html>

More information about the 2d-dev mailing list