From 0fc818ec6e012243303de3e013037c8c0221c83f Mon Sep 17 00:00:00 2001 From: "aelias@chromium.org" Date: Mon, 18 Mar 2013 06:45:20 +0000 Subject: cc: Delay start of scrollbar animation setNeedsRedraw. This adds a 300ms delay triggered at ScrollEnd in order to avoid beginning the setNeedsRedraw cycle until we really start fading the scrollbar, in order to improve performance during non-fling scrolls. Notes: - I switched to notifying the animator about ScrollBegin/ScrollEnd when the currently scrolling layer is attached/detached, and suppress fading until ScrollEnd. - The scrollUpdate path is still needed for when the scroll position changes due to e.g. Javascript, but it's a no-op during a scroll gesture. - I deleted the pinchGesture logic for simplicity, as there's no reason to treat pinches differently from scrolls. - I switches cc::Thread to use TimeDelta for its postDelayedTask since I ran into some bugs with the flooring to milliseconds. I updated the few other callers. NOTRY=true BUG=181417 Review URL: https://chromiumcodereview.appspot.com/12408028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188684 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/test/scheduler_test_common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cc/test/scheduler_test_common.h') diff --git a/cc/test/scheduler_test_common.h b/cc/test/scheduler_test_common.h index e5faaa5..760ba2568 100644 --- a/cc/test/scheduler_test_common.h +++ b/cc/test/scheduler_test_common.h @@ -6,6 +6,7 @@ #define CC_TEST_SCHEDULER_TEST_COMMON_H_ #include "base/memory/scoped_ptr.h" +#include "base/time.h" #include "cc/base/thread.h" #include "cc/delay_based_time_source.h" #include "cc/frame_rate_controller.h" @@ -52,7 +53,8 @@ public: } virtual void PostTask(base::Closure cb) OVERRIDE; - virtual void PostDelayedTask(base::Closure cb, long long delay_ms) OVERRIDE; + virtual void PostDelayedTask(base::Closure cb, base::TimeDelta delay) + OVERRIDE; virtual bool BelongsToCurrentThread() const OVERRIDE; protected: -- cgit v1.1