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

Unified Diff: cc/layers/layer_impl.cc

Issue 2769793002: Implement CSS: scroll-boundary-behavior (Closed)
Patch Set: Use only gpuBenchmarking. Created 3 years, 7 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 e40b5701e13286410170cac28dcf0f89a8237d62..0b7dc41d62289140e961f67d9867cb20a55db7a2 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -81,7 +81,9 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id)
needs_push_properties_(false),
scrollbars_hidden_(false),
needs_show_scrollbars_(false),
- raster_even_if_not_in_rsll_(false) {
+ raster_even_if_not_in_rsll_(false),
+ scroll_boundary_behavior_(
+ ScrollBoundaryBehavior::kScrollBoundaryBehaviorTypeAuto) {
DCHECK_GT(layer_id_, 0);
DCHECK(layer_tree_impl_);
@@ -353,6 +355,7 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
layer->SetBounds(bounds_);
layer->SetScrollClipLayer(scroll_clip_layer_id_);
layer->SetMutableProperties(mutable_properties_);
+ layer->SetScrollBoundaryBehavior(scroll_boundary_behavior_);
// If the main thread commits multiple times before the impl thread actually
// draws, then damage tracking will become incorrect if we simply clobber the
@@ -770,6 +773,15 @@ gfx::Vector2dF LayerImpl::ClampScrollToMaxScrollOffset() {
return delta;
}
+void LayerImpl::SetScrollBoundaryBehavior(
+ const ScrollBoundaryBehavior& behavior) {
+ if (scroll_boundary_behavior_ == behavior)
+ return;
+ scroll_boundary_behavior_ = behavior;
+ layer_tree_impl()->DidUpdateScrollState(id());
+ NoteLayerPropertyChanged();
+}
+
void LayerImpl::SetNeedsPushProperties() {
if (layer_tree_impl_ && !needs_push_properties_) {
needs_push_properties_ = true;

Powered by Google App Engine
This is Rietveld 408576698