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

Side by Side Diff: cc/layers/layer_impl.cc

Issue 698003006: Fix double subtraction of sent_delta on sync tree activation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/debug/trace_event_argument.h" 8 #include "base/debug/trace_event_argument.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 is_container_for_fixed_position_layers_); 543 is_container_for_fixed_position_layers_);
544 layer->SetPositionConstraint(position_constraint_); 544 layer->SetPositionConstraint(position_constraint_);
545 layer->SetShouldFlattenTransform(should_flatten_transform_); 545 layer->SetShouldFlattenTransform(should_flatten_transform_);
546 layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_); 546 layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_);
547 layer->SetTransformAndInvertibility(transform_, transform_is_invertible_); 547 layer->SetTransformAndInvertibility(transform_, transform_is_invertible_);
548 548
549 layer->SetScrollClipLayer(scroll_clip_layer_ ? scroll_clip_layer_->id() 549 layer->SetScrollClipLayer(scroll_clip_layer_ ? scroll_clip_layer_->id()
550 : Layer::INVALID_ID); 550 : Layer::INVALID_ID);
551 layer->set_user_scrollable_horizontal(user_scrollable_horizontal_); 551 layer->set_user_scrollable_horizontal(user_scrollable_horizontal_);
552 layer->set_user_scrollable_vertical(user_scrollable_vertical_); 552 layer->set_user_scrollable_vertical(user_scrollable_vertical_);
553 layer->SetScrollOffsetAndDelta( 553
554 scroll_offset_, 554 // Save the difference but clear the sent delta so that we don't subtract
555 layer->ScrollDelta() - layer->sent_scroll_delta()); 555 // it again in SetScrollOffsetAndDelta's pending twin mirroring logic.
556 gfx::Vector2dF remaining_delta =
557 layer->ScrollDelta() - layer->sent_scroll_delta();
556 layer->SetSentScrollDelta(gfx::Vector2dF()); 558 layer->SetSentScrollDelta(gfx::Vector2dF());
559 layer->SetScrollOffsetAndDelta(scroll_offset_, remaining_delta);
560
557 layer->Set3dSortingContextId(sorting_context_id_); 561 layer->Set3dSortingContextId(sorting_context_id_);
558 layer->SetNumDescendantsThatDrawContent(num_descendants_that_draw_content_); 562 layer->SetNumDescendantsThatDrawContent(num_descendants_that_draw_content_);
559 563
560 LayerImpl* scroll_parent = nullptr; 564 LayerImpl* scroll_parent = nullptr;
561 if (scroll_parent_) { 565 if (scroll_parent_) {
562 scroll_parent = layer->layer_tree_impl()->LayerById(scroll_parent_->id()); 566 scroll_parent = layer->layer_tree_impl()->LayerById(scroll_parent_->id());
563 DCHECK(scroll_parent); 567 DCHECK(scroll_parent);
564 } 568 }
565 569
566 layer->SetScrollParent(scroll_parent); 570 layer->SetScrollParent(scroll_parent);
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1589 1593
1590 void LayerImpl::NotifyAnimationFinished( 1594 void LayerImpl::NotifyAnimationFinished(
1591 base::TimeTicks monotonic_time, 1595 base::TimeTicks monotonic_time,
1592 Animation::TargetProperty target_property, 1596 Animation::TargetProperty target_property,
1593 int group) { 1597 int group) {
1594 if (target_property == Animation::ScrollOffset) 1598 if (target_property == Animation::ScrollOffset)
1595 layer_tree_impl_->InputScrollAnimationFinished(); 1599 layer_tree_impl_->InputScrollAnimationFinished();
1596 } 1600 }
1597 1601
1598 } // namespace cc 1602 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698