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

Unified Diff: cc/layer_tree_impl.cc

Issue 12408028: cc: Delay start of scrollbar animation setNeedsRedraw. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to 188682 Created 7 years, 9 months 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/layer_tree_impl.h ('k') | cc/resource_update_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tree_impl.cc
diff --git a/cc/layer_tree_impl.cc b/cc/layer_tree_impl.cc
index dde8fe466e7442b8aeb5938726409dd6d7c24768..10747b8deda5f43a1fc7c7330573a2f40bf5a5b4 100644
--- a/cc/layer_tree_impl.cc
+++ b/cc/layer_tree_impl.cc
@@ -13,6 +13,7 @@
#include "cc/layer_tree_host_common.h"
#include "cc/layer_tree_host_impl.h"
#include "cc/pinch_zoom_scrollbar.h"
+#include "cc/scrollbar_animation_controller.h"
#include "cc/scrollbar_layer_impl.h"
#include "ui/gfx/size_conversions.h"
#include "ui/gfx/vector2d_conversions.h"
@@ -145,8 +146,21 @@ LayerImpl* LayerTreeImpl::CurrentlyScrollingLayer() const {
return currently_scrolling_layer_;
}
+void LayerTreeImpl::SetCurrentlyScrollingLayer(LayerImpl* layer) {
+ if (currently_scrolling_layer_ == layer)
+ return;
+
+ if (currently_scrolling_layer_ &&
+ currently_scrolling_layer_->scrollbar_animation_controller())
+ currently_scrolling_layer_->scrollbar_animation_controller()
+ ->didScrollGestureEnd(base::TimeTicks::Now());
+ currently_scrolling_layer_ = layer;
+ if (layer && layer->scrollbar_animation_controller())
+ layer->scrollbar_animation_controller()->didScrollGestureBegin();
+}
+
void LayerTreeImpl::ClearCurrentlyScrollingLayer() {
- currently_scrolling_layer_ = NULL;
+ SetCurrentlyScrollingLayer(NULL);
scrolling_layer_id_from_previous_tree_ = 0;
}
@@ -362,7 +376,7 @@ void LayerTreeImpl::UnregisterLayer(LayerImpl* layer) {
void LayerTreeImpl::PushPersistedState(LayerTreeImpl* pendingTree) {
int id = currently_scrolling_layer_ ? currently_scrolling_layer_->id() : 0;
- pendingTree->set_currently_scrolling_layer(
+ pendingTree->SetCurrentlyScrollingLayer(
LayerTreeHostCommon::findLayerInSubtree(pendingTree->root_layer(), id));
}
« no previous file with comments | « cc/layer_tree_impl.h ('k') | cc/resource_update_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698