changeset 4309:d81166ee8ea0

RT-26889: JavaFX program runs with j2d pipe fails with IllegalStateException on Windows Reviewed-by: anthony, art
author Petr Pchelko <petr.pchelko@oracle.com>
date Tue, 16 Jul 2013 19:42:10 +0400
parents 8eb897ad8dc6
children 71bb731377e2 89c1466e9ba0
files modules/graphics/src/main/java/com/sun/prism/PresentableState.java modules/graphics/src/main/java/com/sun/prism/j2d/J2DPresentable.java
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/prism/PresentableState.java	Tue Jul 16 08:32:44 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/prism/PresentableState.java	Tue Jul 16 19:42:10 2013 +0400
@@ -61,6 +61,7 @@
     // the associated View can be closed. This variable allows us
     // to shortcut the queued *Painter task.
     protected boolean isClosed;
+    protected final int pixelFormat = Pixels.getNativeFormat();
 
     /** Create a PresentableState based on a View.
      *
@@ -212,6 +213,15 @@
     }
 
     /**
+     * @return native pixel format
+     *
+     * May be called on any thread.
+     */
+    public int getPixelFormat() {
+        return pixelFormat;
+    }
+
+    /**
      * Locks the underlying view for rendering
      *
      * May be called on any thread.
--- a/modules/graphics/src/main/java/com/sun/prism/j2d/J2DPresentable.java	Tue Jul 16 08:32:44 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/prism/j2d/J2DPresentable.java	Tue Jul 16 19:42:10 2013 +0400
@@ -72,7 +72,7 @@
         public BufferedImage createBuffer(int w, int h) {
             pixels = null;
             pixBuf = null;
-            int format = Pixels.getNativeFormat();
+            int format = pState.getPixelFormat();
             if (PrismSettings.verbose) {
                 System.out.println("Glass native format: "+format);
             }