diff options
author | jdduke@chromium.org <jdduke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-15 23:38:24 +0000 |
---|---|---|
committer | jdduke@chromium.org <jdduke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-15 23:39:25 +0000 |
commit | cffc32811f74487652b5c34f28ec9a1a752919c3 (patch) | |
tree | 018ab2fad4698371d81381146def0a25f6a7fb05 /cc | |
parent | c0f4e82b47a13263809b23741dd33fe1f158f90b (diff) | |
download | chromium_src-cffc32811f74487652b5c34f28ec9a1a752919c3.zip chromium_src-cffc32811f74487652b5c34f28ec9a1a752919c3.tar.gz chromium_src-cffc32811f74487652b5c34f28ec9a1a752919c3.tar.bz2 |
[Android] Implementation of overscroll effect for Android L
Add an overscroll effect implementation that mimics that of Android L. The
primary differences are the use of a single rasterized arc layer and the
inclusion of motion orthogonal to overscroll in computing the effect offset.
BUG=389744
Review URL: https://codereview.chromium.org/367173003
Cr-Commit-Position: refs/heads/master@{#290052}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@290052 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/input/input_handler.h | 3 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl.cc | 6 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest_scroll.cc | 7 |
3 files changed, 9 insertions, 7 deletions
diff --git a/cc/input/input_handler.h b/cc/input/input_handler.h index 9cf764e..880c208 100644 --- a/cc/input/input_handler.h +++ b/cc/input/input_handler.h @@ -35,7 +35,8 @@ class CC_EXPORT InputHandlerClient { // Called when scroll deltas reaching the root scrolling layer go unused. // The accumulated overscroll is scoped by the most recent call to // InputHandler::ScrollBegin. - virtual void DidOverscroll(const gfx::Vector2dF& accumulated_overscroll, + virtual void DidOverscroll(const gfx::PointF& causal_event_viewport_point, + const gfx::Vector2dF& accumulated_overscroll, const gfx::Vector2dF& latest_overscroll_delta) = 0; protected: diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 2845d18..705598b 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -2672,8 +2672,8 @@ bool LayerTreeHostImpl::ScrollBy(const gfx::Point& viewport_point, accumulated_root_overscroll_ += unused_root_delta; bool did_overscroll = !unused_root_delta.IsZero(); if (did_overscroll && input_handler_client_) { - input_handler_client_->DidOverscroll(accumulated_root_overscroll_, - unused_root_delta); + input_handler_client_->DidOverscroll( + viewport_point, accumulated_root_overscroll_, unused_root_delta); } return did_scroll_content || did_scroll_top_controls; @@ -3297,7 +3297,7 @@ void LayerTreeHostImpl::CreateUIResource(UIResourceId uid, case UIResourceBitmap::ETC1: format = ETC1; break; - }; + } id = resource_provider_->CreateResource( bitmap.GetSize(), wrap_mode, diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc index e1eb884..60ca59b 100644 --- a/cc/trees/layer_tree_host_unittest_scroll.cc +++ b/cc/trees/layer_tree_host_unittest_scroll.cc @@ -1073,9 +1073,10 @@ class ThreadCheckingInputHandlerClient : public InputHandlerClient { *received_stop_flinging_ = true; } - virtual void DidOverscroll(const gfx::Vector2dF& accumulated_overscroll, - const gfx::Vector2dF& latest_overscroll_delta) - OVERRIDE { + virtual void DidOverscroll( + const gfx::PointF& causal_event_viewport_point, + const gfx::Vector2dF& accumulated_overscroll, + const gfx::Vector2dF& latest_overscroll_delta) OVERRIDE { if (!task_runner_->BelongsToCurrentThread()) ADD_FAILURE() << "DidOverscroll called on wrong thread"; } |