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() && |
+ 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; |