changeset 1660:9041e7dbf755

Fix for RT-24326: Added pulse logging
author rbair
date Thu, 16 Aug 2012 09:54:03 -0700
parents 73aed3d884dd
children de4c5b536f72
files javafx-ui-common/src/javafx/scene/Scene.java
diffstat 1 files changed, 27 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/javafx/scene/Scene.java	Wed Aug 15 11:10:44 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/Scene.java	Thu Aug 16 09:54:03 2012 -0700
@@ -126,6 +126,8 @@
 import javafx.stage.StageStyle;
 import javafx.util.Callback;
 
+import static com.sun.javafx.logging.PulseLogger.PULSE_LOGGING_ENABLED;
+import static com.sun.javafx.logging.PulseLogger.PULSE_LOGGER;
 
 /**
  * The JavaFX {@code Scene} class is the container for all content in a scene graph.
@@ -2203,15 +2205,30 @@
                 PerformanceTracker.logEvent("Scene - first repaint");
             }
 
-            Scene.this.doCSSPass();
-            Scene.this.doLayoutPass();
+            if (PULSE_LOGGING_ENABLED) {
+                long start = System.currentTimeMillis();
+                Scene.this.doCSSPass();
+                PULSE_LOGGER.fxMessage(start, System.currentTimeMillis(), "CSS Pass");
+                
+                start = System.currentTimeMillis();
+                Scene.this.doLayoutPass();
+                PULSE_LOGGER.fxMessage(start, System.currentTimeMillis(), "Layout Pass");
+            } else {
+                Scene.this.doCSSPass();
+                Scene.this.doLayoutPass();
+            }
 
             boolean dirty = dirtyNodes == null || dirtyNodesSize != 0 || !isDirtyEmpty();
             if (dirty) {
                 getRoot().updateBounds();
                 if (impl_peer != null) {
                     try {
+                        long start = PULSE_LOGGING_ENABLED ? System.currentTimeMillis() : 0;
                         impl_peer.waitForSynchronization();
+                        if (PULSE_LOGGING_ENABLED) {
+                            PULSE_LOGGER.fxMessage(start, System.currentTimeMillis(), "Waiting for previous rendering");
+                        }
+                        start = PULSE_LOGGING_ENABLED ? System.currentTimeMillis() : 0;
                         // synchronize scene properties
                         synchronizeSceneProperties();
                         // Run the synchronizer
@@ -2219,13 +2236,21 @@
                         Scene.this.mouseHandler.pulse();
                         // Tell the scene peer that it needs to repaint
                         impl_peer.markDirty();
+                        if (PULSE_LOGGING_ENABLED) {
+                            PULSE_LOGGER.fxMessage(start, System.currentTimeMillis(), "Copy state to render graph");
+                        }
                     } finally {
                         impl_peer.releaseSynchronization();
                     }
                 } else {
+                    long start = PULSE_LOGGING_ENABLED ? System.currentTimeMillis() : 0;
                     synchronizeSceneProperties();
                     synchronizeSceneNodes();
                     Scene.this.mouseHandler.pulse();
+                    if (PULSE_LOGGING_ENABLED) {
+                        PULSE_LOGGER.fxMessage(start, System.currentTimeMillis(), "Synchronize with null peer");
+                    }
+
                 }
             }