Index: content/child/fling_animator_impl_android.cc |
diff --git a/content/child/fling_animator_impl_android.cc b/content/child/fling_animator_impl_android.cc |
index 235f920b48f1cecf757c86ed5c79dd75956deb61..e2921445defe6ff1414fed39a5483e554091a0c6 100644 |
--- a/content/child/fling_animator_impl_android.cc |
+++ b/content/child/fling_animator_impl_android.cc |
@@ -4,6 +4,7 @@ |
#include "content/child/fling_animator_impl_android.h" |
+#include "base/debug/trace_event.h" |
#include "base/logging.h" |
#include "third_party/WebKit/public/platform/WebFloatSize.h" |
#include "third_party/WebKit/public/platform/WebGestureCurveTarget.h" |
@@ -15,6 +16,8 @@ namespace content { |
namespace { |
+const char* kCurveName = "FlingAnimatorImpl"; |
jochen (gone - plz use gerrit)
2014/03/31 09:59:10
why do you declare a variable for this but none of
jdduke (slow)
2014/03/31 15:41:43
I added the trace to mimic what was done in touch_
|
+ |
gfx::Scroller::Config GetScrollerConfig() { |
gfx::Scroller::Config config; |
config.flywheel_enabled = false; |
@@ -26,9 +29,14 @@ gfx::Scroller::Config GetScrollerConfig() { |
FlingAnimatorImpl::FlingAnimatorImpl() |
: is_active_(false), |
- scroller_(GetScrollerConfig()) {} |
+ scroller_(GetScrollerConfig()) { |
+ TRACE_EVENT_ASYNC_BEGIN1( |
+ "input", "GestureAnimation", this, "curve", kCurveName); |
+} |
-FlingAnimatorImpl::~FlingAnimatorImpl() {} |
+FlingAnimatorImpl::~FlingAnimatorImpl() { |
+ TRACE_EVENT_ASYNC_END0("input", "GestureAnimation", this); |
+} |
void FlingAnimatorImpl::StartFling(const gfx::PointF& velocity) { |
// No bounds on the fling. See http://webkit.org/b/96403 |
@@ -72,17 +80,15 @@ bool FlingAnimatorImpl::apply(double /* time */, |
return false; |
} |
- target->notifyCurrentFlingVelocity(blink::WebFloatSize( |
- scroller_.GetCurrVelocityX(), scroller_.GetCurrVelocityY())); |
- |
gfx::PointF current_position(scroller_.GetCurrX(), scroller_.GetCurrY()); |
gfx::Vector2dF scroll_amount(current_position - last_position_); |
last_position_ = current_position; |
// scrollBy() could delete this curve if the animation is over, so don't touch |
// any member variables after making that call. |
- target->scrollBy(blink::WebFloatSize(scroll_amount)); |
- return true; |
+ return target->scrollBy(blink::WebFloatSize(scroll_amount), |
+ blink::WebFloatSize(scroller_.GetCurrVelocityX(), |
+ scroller_.GetCurrVelocityY())); |
} |
FlingAnimatorImpl* FlingAnimatorImpl::CreateAndroidGestureCurve( |