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

Unified Diff: cc/layers/layer.cc

Issue 800613009: Convert scroll offsets to use SyncedProperty. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android WebView tests Created 5 years, 11 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_impl.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 4aef7da3e68552d32e638a41b468c244dd94a418..face433a808db2c90727fb0b55880b4d3bddcf8e 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -978,21 +978,10 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
layer->SetClipChildren(nullptr);
}
- // Adjust the scroll delta to be just the scrolls that have happened since
- // the BeginMainFrame was sent. This happens for impl-side painting
- // in LayerImpl::ApplyScrollDeltasSinceBeginMainFrame in a separate tree walk.
- if (layer->layer_tree_impl()->settings().impl_side_painting) {
- layer->SetScrollOffset(scroll_offset_);
- } else {
- if (layer_animation_controller_
- ->scroll_offset_animation_was_interrupted()) {
- layer->SetScrollOffsetAndDelta(scroll_offset_, gfx::Vector2dF());
- } else {
- layer->SetScrollOffsetAndDelta(
- scroll_offset_, layer->ScrollDelta() - layer->sent_scroll_delta());
- }
- layer->SetSentScrollDelta(gfx::Vector2dF());
- }
+ layer->PushScrollOffsetFromMainThread(scroll_offset_);
+ if (layer_animation_controller_->scroll_offset_animation_was_interrupted() &&
+ layer->IsActive())
+ layer->SetScrollDelta(gfx::Vector2dF());
layer->SetScrollCompensationAdjustment(ScrollCompensationAdjustment());
// Wrap the copy_requests_ in a PostTask to the main thread.
@@ -1041,7 +1030,8 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
}
scoped_ptr<LayerImpl> Layer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
- return LayerImpl::Create(tree_impl, layer_id_);
+ return LayerImpl::Create(tree_impl, layer_id_,
+ new LayerImpl::SyncedScrollOffset);
}
bool Layer::DrawsContent() const {
@@ -1135,7 +1125,7 @@ void Layer::ClearRenderSurfaceLayerList() {
}
gfx::ScrollOffset Layer::ScrollOffsetForAnimation() const {
- return TotalScrollOffset();
+ return CurrentScrollOffset();
}
// On<Property>Animated is called due to an ongoing accelerated animation.
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698