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

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: 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
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index fb72c73b9c483b0b289a429e75e4095e3b71797d..f50235cb8e58d446ffa84f0a70ea96a8a882c003 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -965,17 +965,7 @@ 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 {
- layer->SetScrollOffsetAndDelta(
- scroll_offset_,
- layer->ScrollDelta() - layer->sent_scroll_delta());
- layer->SetSentScrollDelta(gfx::Vector2dF());
- }
+ layer->PushScrollOffsetFromMainThread(scroll_offset_);
// Wrap the copy_requests_ in a PostTask to the main thread.
ScopedPtrVector<CopyOutputRequest> main_thread_copy_requests;
@@ -1018,7 +1008,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 {
@@ -1111,8 +1102,8 @@ void Layer::ClearRenderSurfaceLayerList() {
render_surface_->ClearLayerLists();
}
-gfx::ScrollOffset Layer::ScrollOffsetForAnimation() const {
- return TotalScrollOffset();
+gfx::ScrollOffset Layer::ScrollOffsetForAnimation() {
+ 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') | cc/layers/layer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698