changeset 3761:3e330c5301c2

RT-30287: No rendering after scene graph update due to poor synchronization
author snorthov
date Wed, 29 May 2013 23:46:42 -0400
parents eb0ca6ba0558
children c200cd542665
files javafx-ui-common/src/com/sun/javafx/tk/TKScene.java javafx-ui-common/src/javafx/scene/Scene.java javafx-ui-quantum/src/com/sun/javafx/tk/quantum/GlassScene.java javafx-ui-quantum/src/com/sun/javafx/tk/quantum/PaintCollector.java test-stub-toolkit/src/com/sun/javafx/pgstub/StubScene.java
diffstat 5 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/com/sun/javafx/tk/TKScene.java	Wed May 29 16:57:48 2013 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/tk/TKScene.java	Wed May 29 23:46:42 2013 -0400
@@ -45,6 +45,8 @@
      */
     public void setSecurityContext(AccessControlContext ctx);
 
+    public void waitForRenderingToComplete();
+    
     /**
      * Waits until the render thread is available for synchronization
      * from the scene graph. Once this method returns, the caller has
--- a/javafx-ui-common/src/javafx/scene/Scene.java	Wed May 29 16:57:48 2013 -0400
+++ b/javafx-ui-common/src/javafx/scene/Scene.java	Wed May 29 23:46:42 2013 -0400
@@ -2392,6 +2392,7 @@
                 if (impl_peer != null) {
                     try {
                         long start = PULSE_LOGGING_ENABLED ? System.currentTimeMillis() : 0;
+                        impl_peer.waitForRenderingToComplete();
                         impl_peer.waitForSynchronization();
                         if (PULSE_LOGGING_ENABLED) {
                             PULSE_LOGGER.fxMessage(start, System.currentTimeMillis(), "Waiting for previous rendering");
--- a/javafx-ui-quantum/src/com/sun/javafx/tk/quantum/GlassScene.java	Wed May 29 16:57:48 2013 -0400
+++ b/javafx-ui-quantum/src/com/sun/javafx/tk/quantum/GlassScene.java	Wed May 29 23:46:42 2013 -0400
@@ -103,6 +103,10 @@
         accessCtrlCtx = ctx;
     }
 
+    public void waitForRenderingToComplete() {
+        PaintCollector.getInstance().waitForRenderingToComplete();
+    }
+
     @Override
     public void waitForSynchronization() {
         AbstractPainter.renderLock.lock();
--- a/javafx-ui-quantum/src/com/sun/javafx/tk/quantum/PaintCollector.java	Wed May 29 16:57:48 2013 -0400
+++ b/javafx-ui-quantum/src/com/sun/javafx/tk/quantum/PaintCollector.java	Wed May 29 23:46:42 2013 -0400
@@ -161,7 +161,7 @@
      * Called by renderAll to wait for rendering to complete before
      * continuing.
      */
-    private void waitForRenderingToComplete() {
+    void waitForRenderingToComplete() {
         while (true) {
             try {
                 // We need to keep waiting until things are done!
@@ -380,9 +380,6 @@
         // then we want to process them first.
         Collections.sort(dirtyScenes, DIRTY_SCENE_SORTER);
 
-        // Here we will block and wait for all
-        waitForRenderingToComplete();
-
         // Reset the fields
         hasDirty = false;
         needsHint = false;
--- a/test-stub-toolkit/src/com/sun/javafx/pgstub/StubScene.java	Wed May 29 16:57:48 2013 -0400
+++ b/test-stub-toolkit/src/com/sun/javafx/pgstub/StubScene.java	Wed May 29 23:46:42 2013 -0400
@@ -51,6 +51,10 @@
         // ignore
     }
 
+    public void waitForRenderingToComplete() {
+        // ignore
+    }
+    
     public void waitForSynchronization() {
         //ignore
     }