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

Unified Diff: cc/layers/layer.cc

Issue 903273002: Update from https://crrev.com/315085 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/layers/layer.h ('k') | cc/layers/layer_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index face433a808db2c90727fb0b55880b4d3bddcf8e..01e67c5edc6d586ba12b677cfa11e33f8e9fb429 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -71,6 +71,7 @@ Layer::Layer()
force_render_surface_(false),
transform_is_invertible_(true),
has_render_surface_(false),
+ scroll_blocks_on_(ScrollBlocksOnNone),
background_color_(0),
opacity_(1.f),
blend_mode_(SkXfermode::kSrcOver_Mode),
@@ -758,6 +759,14 @@ void Layer::SetTouchEventHandlerRegion(const Region& region) {
SetNeedsCommit();
}
+void Layer::SetScrollBlocksOn(ScrollBlocksOn scroll_blocks_on) {
+ DCHECK(IsPropertyChangeAllowed());
+ if (scroll_blocks_on_ == scroll_blocks_on)
+ return;
+ scroll_blocks_on_ = scroll_blocks_on;
+ SetNeedsCommit();
+}
+
void Layer::SetDrawCheckerboardForMissingTiles(bool checkerboard) {
DCHECK(IsPropertyChangeAllowed());
if (draw_checkerboard_for_missing_tiles_ == checkerboard)
@@ -911,6 +920,7 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
layer->SetHaveScrollEventHandlers(have_scroll_event_handlers_);
layer->SetNonFastScrollableRegion(non_fast_scrollable_region_);
layer->SetTouchEventHandlerRegion(touch_event_handler_region_);
+ layer->SetScrollBlocksOn(scroll_blocks_on_);
layer->SetContentsOpaque(contents_opaque_);
if (!layer->OpacityIsAnimatingOnImplOnly() && !OpacityIsAnimating())
layer->SetOpacity(opacity_);
@@ -978,10 +988,14 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
layer->SetClipChildren(nullptr);
}
- layer->PushScrollOffsetFromMainThread(scroll_offset_);
- if (layer_animation_controller_->scroll_offset_animation_was_interrupted() &&
- layer->IsActive())
- layer->SetScrollDelta(gfx::Vector2dF());
+ // When a scroll offset animation is interrupted the new scroll position on
+ // the pending tree will clobber any impl-side scrolling occuring on the
+ // active tree. To do so, avoid scrolling the pending tree along with it
+ // instead of trying to undo that scrolling later.
+ if (layer_animation_controller_->scroll_offset_animation_was_interrupted())
+ layer->PushScrollOffsetFromMainThreadAndClobberActiveValue(scroll_offset_);
+ else
+ layer->PushScrollOffsetFromMainThread(scroll_offset_);
layer->SetScrollCompensationAdjustment(ScrollCompensationAdjustment());
// Wrap the copy_requests_ in a PostTask to the main thread.
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698