[gnome-shell] [perf] add tweener.framePrepareStart/Done events



commit 07cfb8d524c47e03d3196ddaac8cb4dc2fbfd61e
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Mon May 24 09:48:41 2010 -0400

    [perf] add tweener.framePrepareStart/Done events
    
    Add events when we start preparing a frame and finish preparing
    a frame. (In addition to measuring property-updating overhead, this allows
    us to see the interval between finishing preparing a frame and starting
    painting the frame, which is the relayout time.)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=619515

 js/ui/tweener.js |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/tweener.js b/js/ui/tweener.js
index 60aaa8d..f2e3b53 100644
--- a/js/ui/tweener.js
+++ b/js/ui/tweener.js
@@ -4,6 +4,7 @@ const Clutter = imports.gi.Clutter;
 const GLib = imports.gi.GLib;
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
+const Shell = imports.gi.Shell;
 const Signals = imports.signals;
 const Tweener = imports.tweener.tweener;
 
@@ -221,6 +222,14 @@ ClutterFrameTicker.prototype = {
             function(timeline, frame) {
                 this._onNewFrame(frame);
             }));
+
+        let perf_log = Shell.PerfLog.get_default();
+        perf_log.define_event("tweener.framePrepareStart",
+                              "Start of a new animation frame",
+                              "");
+        perf_log.define_event("tweener.framePrepareDone",
+                              "Finished preparing frame",
+                              "");
     },
 
     _onNewFrame : function(frame) {
@@ -233,8 +242,11 @@ ClutterFrameTicker.prototype = {
             this._startTime = this._timeline.get_elapsed_time();
 
         // currentTime is in milliseconds
+        let perf_log = Shell.PerfLog.get_default();
         this._currentTime = (this._timeline.get_elapsed_time() - this._startTime) / slowDownFactor;
+        perf_log.event("tweener.framePrepareStart");
         this.emit('prepare-frame');
+        perf_log.event("tweener.framePrepareDone");
     },
 
     getTime : function() {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]