Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1681)

Unified Diff: cc/input/scroll_elasticity_helper.cc

Issue 786123002: Update from https://crrev.com/307330 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/cc.gyp ('k') | cc/input/top_controls_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/input/scroll_elasticity_helper.cc
diff --git a/cc/input/scroll_elasticity_helper.cc b/cc/input/scroll_elasticity_helper.cc
index 54da888ff7692951252427bf852f35d471312219..6a38e4b3bae34e6854c2099cb799ca0af14e00b1 100644
--- a/cc/input/scroll_elasticity_helper.cc
+++ b/cc/input/scroll_elasticity_helper.cc
@@ -32,6 +32,7 @@ bool ScrollElasticityHelper::AllowsVerticalStretching() {
}
gfx::Vector2dF ScrollElasticityHelper::StretchAmount() {
+ // TODO(ccameron): Use the value of active_tree->elastic_overscroll directly
return stretch_offset_;
}
@@ -63,7 +64,7 @@ bool ScrollElasticityHelper::CanScrollVertically() {
gfx::Vector2dF ScrollElasticityHelper::AbsoluteScrollPosition() {
// TODO(ccameron): This is function is redundant and may be removed.
- return stretch_offset_;
+ return StretchAmount();
}
void ScrollElasticityHelper::ImmediateScrollBy(const gfx::Vector2dF& scroll) {
@@ -73,9 +74,14 @@ void ScrollElasticityHelper::ImmediateScrollBy(const gfx::Vector2dF& scroll) {
void ScrollElasticityHelper::ImmediateScrollByWithoutContentEdgeConstraints(
const gfx::Vector2dF& scroll) {
stretch_offset_ += scroll;
-
- // TODO(ccameron): Update the transform of the appropriate layer in the
- // LayerTreeHostImpl, and request that a frame be drawn.
+ // TODO(ccameron): Use the value of active_tree->elastic_overscroll directly
+ // Note that this assumes that this property's true value is ever changed
+ // by the impl thread. While this is true, it is redundant state.
+ layer_tree_host_impl_->active_tree()->elastic_overscroll()->SetCurrent(
+ -stretch_offset_);
+ layer_tree_host_impl_->active_tree()->set_needs_update_draw_properties();
+ layer_tree_host_impl_->SetNeedsCommit();
+ layer_tree_host_impl_->SetNeedsRedraw();
}
void ScrollElasticityHelper::StartSnapRubberbandTimer() {
« no previous file with comments | « cc/cc.gyp ('k') | cc/input/top_controls_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698