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

Unified Diff: cc/layers/layer_impl.cc

Issue 1215183004: Arrange compositor scrolling into scroll customization format (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 5 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/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 5c20611b03f6695fbdb6c2be402ebbfd864fcdff..957bd2cee503e3dac5a6c459ae1a3d74c5ffddb9 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -17,6 +17,7 @@
#include "cc/debug/layer_tree_debug_state.h"
#include "cc/debug/micro_benchmark_impl.h"
#include "cc/debug/traced_value.h"
+#include "cc/input/scroll_state.h"
#include "cc/layers/layer_utils.h"
#include "cc/layers/painted_scrollbar_layer_impl.h"
#include "cc/output/copy_output_request.h"
@@ -197,6 +198,30 @@ void LayerImpl::SetScrollChildren(std::set<LayerImpl*>* children) {
SetNeedsPushProperties();
}
+void LayerImpl::DistributeScroll(ScrollState* scroll_state) {
+ DCHECK(scroll_state);
+ if (scroll_state->FullyConsumed())
+ return;
+
+ scroll_state->DistributeToScrollChainDescendant();
+
+ // If the scroll doesn't propagate, and we're currently scrolling
+ // a layer other than this one, prevent the scroll from
+ // propagating to this layer.
+ if (!scroll_state->should_propagate() &&
+ scroll_state->delta_consumed_for_scroll_sequence() &&
Ian Vollick 2015/07/30 19:02:25 Hmm, what if we shouldn't propagate, and the true
tdresser 2015/07/30 20:34:20 delta_consumed_for_scroll_sequence persists for th
+ scroll_state->current_native_scrolling_layer() != this) {
+ return;
+ }
+
+ ApplyScroll(scroll_state);
+}
+
+void LayerImpl::ApplyScroll(ScrollState* scroll_state) {
+ DCHECK(scroll_state);
+ layer_tree_impl()->ApplyScroll(this, scroll_state);
+}
+
void LayerImpl::SetNumDescendantsThatDrawContent(int num_descendants) {
if (num_descendants_that_draw_content_ == num_descendants)
return;
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/viewport.cc » ('j') | cc/trees/layer_tree_host_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698