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

Alexandr Scherbatiy alexandr.scherbatiy at oracle.com
Fri Oct 28 11:27:17 UTC 2016

  350         if (!isAccelerationEnabled()) {
  351             // Ideally there is no need to re-create a software 
surface. But
  352             // some OSs allow changes to display state at runtime. 
Such a
  353             // provision would cause mismatch in graphics 
configuration of the
  354             // display and the surface. Hence we re-create the 
software surface
  355             // as well.
  356             sdBackup = null;
  357             sdCurrent = getBackupSurface();
  358         }
  359     }

It seems that the surface is always recreated when the acceleration is 
not enabled. May be it should be only done when the graphics 
configuration transform scales are differ from the ones from vImg 
graphics configuration?


On 10/14/2016 1:38 PM, Prahalad Kumar Narayanan wrote:
> 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/20161028/86a34e80/attachment.html>

More information about the 2d-dev mailing list