[chromium] Instrument gesture animations with async traces
authornduca@chromium.org <nduca@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Mar 2012 05:03:09 +0000 (05:03 +0000)
committernduca@chromium.org <nduca@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Mar 2012 05:03:09 +0000 (05:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82076

Reviewed by Adrienne Walker.

Source/WebCore:

* platform/ActivePlatformGestureAnimation.cpp:
(WebCore::ActivePlatformGestureAnimation::~ActivePlatformGestureAnimation):
(WebCore::ActivePlatformGestureAnimation::ActivePlatformGestureAnimation):
* platform/PlatformGestureCurve.h:
(PlatformGestureCurve):
* platform/TouchpadFlingPlatformGestureCurve.h:
(WebCore::TouchpadFlingPlatformGestureCurve::debugName):
* platform/WheelFlingPlatformGestureCurve.h:
(WebCore::WheelFlingPlatformGestureCurve::debugName):
* platform/graphics/chromium/cc/CCActiveGestureAnimation.cpp:
(WebCore::CCActiveGestureAnimation::CCActiveGestureAnimation):
(WebCore::CCActiveGestureAnimation::~CCActiveGestureAnimation):
* platform/graphics/chromium/cc/CCGestureCurve.h:
(CCGestureCurve):

Source/WebKit/chromium:

* src/WebCompositorInputHandlerImpl.cpp:
(WebCore::PlatformGestureToCCGestureAdapter::debugName):
(PlatformGestureToCCGestureAdapter):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112024 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/ActivePlatformGestureAnimation.cpp
Source/WebCore/platform/PlatformGestureCurve.h
Source/WebCore/platform/TouchpadFlingPlatformGestureCurve.h
Source/WebCore/platform/WheelFlingPlatformGestureCurve.h
Source/WebCore/platform/graphics/chromium/cc/CCActiveGestureAnimation.cpp
Source/WebCore/platform/graphics/chromium/cc/CCGestureCurve.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp

index d4a5710fa1465891d0a37585cebb60e4e02ae57c..3580158534e66cd59fedfb4d2ae32b7ae31fe612 100644 (file)
@@ -1,3 +1,25 @@
+2012-03-24  Nat Duca  <nduca@chromium.org>
+
+        [chromium] Instrument gesture animations with async traces
+        https://bugs.webkit.org/show_bug.cgi?id=82076
+
+        Reviewed by Adrienne Walker.
+
+        * platform/ActivePlatformGestureAnimation.cpp:
+        (WebCore::ActivePlatformGestureAnimation::~ActivePlatformGestureAnimation):
+        (WebCore::ActivePlatformGestureAnimation::ActivePlatformGestureAnimation):
+        * platform/PlatformGestureCurve.h:
+        (PlatformGestureCurve):
+        * platform/TouchpadFlingPlatformGestureCurve.h:
+        (WebCore::TouchpadFlingPlatformGestureCurve::debugName):
+        * platform/WheelFlingPlatformGestureCurve.h:
+        (WebCore::WheelFlingPlatformGestureCurve::debugName):
+        * platform/graphics/chromium/cc/CCActiveGestureAnimation.cpp:
+        (WebCore::CCActiveGestureAnimation::CCActiveGestureAnimation):
+        (WebCore::CCActiveGestureAnimation::~CCActiveGestureAnimation):
+        * platform/graphics/chromium/cc/CCGestureCurve.h:
+        (CCGestureCurve):
+
 2012-03-24  Jeffrey Pfau  <jpfau@apple.com>
 
         XML error document creation should not fire mutation events
index 18ec7eb34ae2e4e07b56c14a3e02a3378bad9d50..99dbbe0e758a12f5f4ad575ea309a2fc582bcc0d 100644 (file)
 #include "PlatformGestureCurve.h"
 #include "PlatformGestureCurveTarget.h"
 
+#if PLATFORM(CHROMIUM)
+#include "TraceEvent.h"
+#endif
+
 namespace WebCore {
 
 PassOwnPtr<ActivePlatformGestureAnimation> ActivePlatformGestureAnimation::create(PassOwnPtr<PlatformGestureCurve> curve, PlatformGestureCurveTarget* target)
@@ -39,6 +43,9 @@ PassOwnPtr<ActivePlatformGestureAnimation> ActivePlatformGestureAnimation::creat
 
 ActivePlatformGestureAnimation::~ActivePlatformGestureAnimation()
 {
+#if PLATFORM(CHROMIUM)
+    TRACE_EVENT_FINISH0("input", "GestureAnimation", this);
+#endif
 }
 
 ActivePlatformGestureAnimation::ActivePlatformGestureAnimation(PassOwnPtr<PlatformGestureCurve> curve, PlatformGestureCurveTarget* target)
@@ -47,6 +54,9 @@ ActivePlatformGestureAnimation::ActivePlatformGestureAnimation(PassOwnPtr<Platfo
     , m_curve(curve)
     , m_target(target)
 {
+#if PLATFORM(CHROMIUM)
+    TRACE_EVENT_START1("input", "GestureAnimation", this, "curve", curve->debugName());
+#endif
 }
 
 bool ActivePlatformGestureAnimation::animate(double time)
index 9221991478ea9c1893f96b3ff0eed7ef64c77c42..06124d86009ec69ddba8b54bd1a70303082b6be3 100644 (file)
@@ -37,6 +37,9 @@ class PlatformGestureCurve {
 public:
     virtual ~PlatformGestureCurve() { }
 
+    // Returns a name of the curve for use in debugging.
+    virtual const char* debugName() const = 0;
+
     // Returns false if curve has finished and can no longer be applied.
     virtual bool apply(double time, PlatformGestureCurveTarget*) = 0;
 };
index 4e5b19be282f3dc3e02ba840339db8ba6574d9ac..6bfa04e911f69f3346ce86ed686ed849f842eab9 100644 (file)
@@ -45,6 +45,7 @@ public:
     static PassOwnPtr<PlatformGestureCurve> create(const FloatPoint& velocity, const float unitTimeScaleLog10, const FloatPoint& bezierP1, const FloatPoint& bezierP2);
     virtual ~TouchpadFlingPlatformGestureCurve();
 
+    virtual const char* debugName() const { return "TouchpadFling"; }
     virtual bool apply(double monotonicTime, PlatformGestureCurveTarget*);
 
 private:
index b72146165333f23c8c9bbf6c01ddbf067aee1ac2..a6eeca40760a6f32301940d39a121c1e20508696 100644 (file)
@@ -43,6 +43,7 @@ public:
     static PassOwnPtr<PlatformGestureCurve> create(const FloatPoint& velocity);
     virtual ~WheelFlingPlatformGestureCurve();
 
+    virtual const char* debugName() const { return "WheelFling"; }
     virtual bool apply(double time, PlatformGestureCurveTarget*);
 
 private:
index dafeca6e753d4ef69c80870d732440e5aae3711f..b96a5276dd1d22b4c63e5b41d0a21d6c680e1fb8 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "cc/CCActiveGestureAnimation.h"
 
+#include "TraceEvent.h"
 #include "cc/CCGestureCurve.h"
 
 namespace WebCore {
@@ -41,10 +42,12 @@ CCActiveGestureAnimation::CCActiveGestureAnimation(PassOwnPtr<CCGestureCurve> cu
     , m_gestureCurve(curve)
     , m_gestureCurveTarget(target)
 {
+    TRACE_EVENT_START1("input", "GestureAnimation", this, "curve", curve->debugName());
 }
 
 CCActiveGestureAnimation::~CCActiveGestureAnimation()
 {
+    TRACE_EVENT_FINISH0("input", "GestureAnimation", this);
 }
 
 bool CCActiveGestureAnimation::animate(double monotonicTime)
index 5d98af4c6c92b07482862c635659ad3d82aec73e..9089a48f30e7e28b35580e721995e27b064e9bbe 100644 (file)
@@ -41,6 +41,8 @@ class CCGestureCurve {
 public:
     virtual ~CCGestureCurve() { }
 
+    virtual const char* debugName() const = 0;
+
     virtual bool apply(double monotonicTime, CCGestureCurveTarget*) = 0;
 };
 
index 0c70d3ce906ebc315812b519731f5a7209dede31..8b6515d1f1c7f5595c5ae4a159523547b23830dd 100644 (file)
@@ -1,3 +1,14 @@
+2012-03-24  Nat Duca  <nduca@chromium.org>
+
+        [chromium] Instrument gesture animations with async traces
+        https://bugs.webkit.org/show_bug.cgi?id=82076
+
+        Reviewed by Adrienne Walker.
+
+        * src/WebCompositorInputHandlerImpl.cpp:
+        (WebCore::PlatformGestureToCCGestureAdapter::debugName):
+        (PlatformGestureToCCGestureAdapter):
+
 2012-03-23  Shawn Singh  <shawnsingh@chromium.org>
 
         [chromium] Incorrect replica originTransform used in CCDamageTracker
index b4e2675cd2a4d9d6533a355e07979169095ec822..94522d24c23f5dc27e7bd7c9e4516bee79ace595 100644 (file)
@@ -55,6 +55,11 @@ public:
         return adoptPtr(new PlatformGestureToCCGestureAdapter(platformCurve));
     }
 
+    virtual const char* debugName() const
+    {
+        return m_curve->debugName();
+    }
+
     virtual bool apply(double time, CCGestureCurveTarget* target)
     {
         ASSERT(target);