changeset 3760:eb0ca6ba0558

Comment RT-26702: Poor DisplacementMap effect performance on Mac [Java code only, fixes potential drawing of garbage on first frame on OS X]
author snorthov
date Wed, 29 May 2013 16:57:48 -0400
parents c75bd11d9865
children 3e330c5301c2
files javafx-ui-quantum/src/com/sun/javafx/tk/quantum/UploadingPainter.java
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-quantum/src/com/sun/javafx/tk/quantum/UploadingPainter.java	Wed May 29 13:35:01 2013 -0700
+++ b/javafx-ui-quantum/src/com/sun/javafx/tk/quantum/UploadingPainter.java	Wed May 29 16:57:48 2013 -0400
@@ -31,6 +31,7 @@
 import com.sun.glass.ui.Pixels;
 import com.sun.glass.ui.View;
 import com.sun.prism.Graphics;
+import com.sun.prism.GraphicsPipeline;
 import com.sun.prism.RTTexture;
 import com.sun.prism.Texture.WrapMode;
 import com.sun.prism.impl.BufferUtil;
@@ -84,6 +85,13 @@
              */
             sceneState.lock();
             locked = true;
+            
+            if (factory == null) {
+                factory = GraphicsPipeline.getDefaultResourceFactory();
+                if (factory == null || !factory.isDeviceReady()) {
+                    return;
+                }
+            }
 
             boolean needsReset = (rttexture == null) || (viewWidth != penWidth) || (viewHeight != penHeight);