changeset 4987:fc17d9decdce

Improved pulse log debugging by adding timings for present
author rbair
date Thu, 05 Sep 2013 14:22:11 -0700
parents f00dbf5f48e9
children b81242a973ce
files modules/graphics/src/main/java/com/sun/javafx/tk/quantum/PresentingPainter.java
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/PresentingPainter.java	Thu Sep 05 14:20:34 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/PresentingPainter.java	Thu Sep 05 14:22:11 2013 -0700
@@ -25,6 +25,7 @@
 
 package com.sun.javafx.tk.quantum;
 
+import com.sun.javafx.logging.PulseLogger;
 import com.sun.prism.Graphics;
 import com.sun.prism.GraphicsPipeline;
 import com.sun.prism.impl.Disposer;
@@ -86,19 +87,27 @@
                 if (g != null) {
                     paintImpl(g);
                 }
-                
+
+                long start = PulseLogger.PULSE_LOGGING_ENABLED ? System.currentTimeMillis() : 0;
                 if (!presentable.prepare(null)) {
                     disposePresentable();
                     sceneState.getScene().entireSceneNeedsRepaint();
+                    if (PulseLogger.PULSE_LOGGING_ENABLED) {
+                        PulseLogger.PULSE_LOGGER.renderMessage(start, System.currentTimeMillis(), "Presentable.prepare");
+                    }
                     return;
                 }
                 
                 /* present for vsync buffer swap */
+                start = PulseLogger.PULSE_LOGGING_ENABLED ? System.currentTimeMillis() : 0;
                 if (vs.getDoPresent()) {
                     if (!presentable.present()) {
                         disposePresentable();
                         sceneState.getScene().entireSceneNeedsRepaint();
                     }
+                    if (PulseLogger.PULSE_LOGGING_ENABLED) {
+                        PulseLogger.PULSE_LOGGER.renderMessage(start, System.currentTimeMillis(), "Presentable.present");
+                    }
                 }
             }
         } catch (Throwable th) {
@@ -119,6 +128,9 @@
                 ManagedResource.printSummary();
             }
             renderLock.unlock();
+            if (PulseLogger.PULSE_LOGGING_ENABLED) {
+                PulseLogger.PULSE_LOGGER.renderMessage(System.currentTimeMillis(), System.currentTimeMillis(), "Finished Presenting Painter");
+            }
         }
     }
 }