changeset 3697:8e02c0e5f19a

Update for RT-30638 Reviewed-by: Kevin Rushforth
author Artem Ananiev <artem.ananiev@oracle.com>
date Tue, 28 May 2013 13:00:23 +0400
parents 73fd2a2b376a
children 296db99bbb34
files javafx-ui-quantum/src/com/sun/javafx/tk/quantum/PresentingPainter.java prism-es2/src/com/sun/prism/es2/ES2SwapChain.java
diffstat 2 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-quantum/src/com/sun/javafx/tk/quantum/PresentingPainter.java	Tue May 28 10:22:33 2013 +0200
+++ b/javafx-ui-quantum/src/com/sun/javafx/tk/quantum/PresentingPainter.java	Tue May 28 13:00:23 2013 +0400
@@ -61,13 +61,15 @@
             sceneState.lock();
             locked = true;
 
-            boolean needsReset = (presentable == null) || presentable.lockResources() ||
+            boolean needsReset = (presentable == null) ||
                                  (penWidth != viewWidth) || (penHeight != viewHeight);
+            if (presentable != null) {
+                needsReset = presentable.lockResources() || needsReset;
+            }
             if (needsReset) {
                 if (presentable == null || presentable.recreateOnResize()) {
                     disposePresentable();
                     presentable = factory.createPresentable(sceneState);
-                    presentable.lockResources(); // report if failed?
                     needsReset = false;
                 }
                 penWidth  = viewWidth;
--- a/prism-es2/src/com/sun/prism/es2/ES2SwapChain.java	Tue May 28 10:22:33 2013 +0200
+++ b/prism-es2/src/com/sun/prism/es2/ES2SwapChain.java	Tue May 28 13:00:23 2013 +0400
@@ -102,6 +102,12 @@
         this.pixelScaleFactor = PrismSettings.allowHiDPIScaling
                                 ? pState.getScale() //TODO fix getScale
                                 : 1.0f;
+        drawable = null;
+        if (pState != null) {
+            long nativeWindow = pState.getNativeWindow();
+            drawable = ES2Pipeline.glFactory.createGLDrawable(
+                    nativeWindow, context.getPixelFormat());
+        }
     }
 
     public boolean lockResources() {
@@ -113,13 +119,6 @@
                 stableBackbuffer = null;
             }
         }
-        drawable = null;
-        if (pState != null) {
-            long nativeWindow = pState.getNativeWindow();
-            drawable = ES2Pipeline.glFactory.createGLDrawable(
-                    nativeWindow, context.getPixelFormat());
-        }
-        context.makeCurrent(drawable);
         return false;
     }
 
@@ -180,6 +179,8 @@
     }
 
     public ES2Graphics createGraphics() {
+        context.makeCurrent(drawable);
+
         GLContext glContext = context.getGLContext();
         nativeDestHandle = glContext.getBoundFBO();