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

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: Clean up, rebase 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 a29123c8e394b95d008e0c9bb927446ac882f3ab..ea3ab2364990e2a3778c2660a06a2a1d5390e900 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->SetMainScrollOffsetFractionalPart(MainScrollOffsetFractionalPart());
// 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') | cc/layers/layer_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698