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

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: Add more test expectations 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
Index: cc/layer_tree_impl.cc
diff --git a/cc/layer_tree_impl.cc b/cc/layer_tree_impl.cc
index b0cbfde2d56d67f912d6a6723cb27e4ffcaba056..c72ab938820ae2ac63e6aca91678046961c86a9d 100644
--- a/cc/layer_tree_impl.cc
+++ b/cc/layer_tree_impl.cc
@@ -8,6 +8,7 @@
#include "cc/heads_up_display_layer_impl.h"
#include "cc/layer_tree_host_common.h"
#include "cc/layer_tree_host_impl.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"
@@ -134,8 +135,19 @@ 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())
jamesr 2013/03/18 01:09:55 80col
+ currently_scrolling_layer_->scrollbar_animation_controller()->didScrollGestureEnd(base::TimeTicks::Now());
jamesr 2013/03/18 01:09:55 80col
+ 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;
}
@@ -354,7 +366,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') | cc/single_thread_proxy.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698