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

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

Issue 2027073002: cc : Use transform node data to determine which transform wins at commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 property_trees->changed = true; 637 property_trees->changed = true;
638 property_trees->effect_tree.set_needs_update(true); 638 property_trees->effect_tree.set_needs_update(true);
639 } 639 }
640 } 640 }
641 641
642 void LayerImpl::UpdatePropertyTreeForScrollingAndAnimationIfNeeded() { 642 void LayerImpl::UpdatePropertyTreeForScrollingAndAnimationIfNeeded() {
643 if (scrollable()) 643 if (scrollable())
644 UpdatePropertyTreeScrollOffset(); 644 UpdatePropertyTreeScrollOffset();
645 645
646 if (HasAnyAnimationTargetingProperty(TargetProperty::TRANSFORM)) { 646 if (HasAnyAnimationTargetingProperty(TargetProperty::TRANSFORM)) {
647 UpdatePropertyTreeTransform();
648 UpdatePropertyTreeTransformIsAnimated( 647 UpdatePropertyTreeTransformIsAnimated(
649 HasPotentiallyRunningTransformAnimation()); 648 HasPotentiallyRunningTransformAnimation());
650 } 649 }
651 } 650 }
652 651
653 gfx::ScrollOffset LayerImpl::ScrollOffsetForAnimation() const { 652 gfx::ScrollOffset LayerImpl::ScrollOffsetForAnimation() const {
654 return CurrentScrollOffset(); 653 return CurrentScrollOffset();
655 } 654 }
656 655
657 void LayerImpl::OnFilterAnimated(const FilterOperations& filters) { 656 void LayerImpl::OnFilterAnimated(const FilterOperations& filters) {
(...skipping 19 matching lines...) Expand all
677 layer_tree_impl()->AddToOpacityAnimationsMap(id(), opacity); 676 layer_tree_impl()->AddToOpacityAnimationsMap(id(), opacity);
678 } 677 }
679 678
680 void LayerImpl::OnTransformAnimated(const gfx::Transform& transform) { 679 void LayerImpl::OnTransformAnimated(const gfx::Transform& transform) {
681 gfx::Transform old_transform = transform_; 680 gfx::Transform old_transform = transform_;
682 SetTransform(transform); 681 SetTransform(transform);
683 UpdatePropertyTreeTransform(); 682 UpdatePropertyTreeTransform();
684 was_ever_ready_since_last_transform_animation_ = false; 683 was_ever_ready_since_last_transform_animation_ = false;
685 if (old_transform != transform) { 684 if (old_transform != transform) {
686 SetNeedsPushProperties(); 685 SetNeedsPushProperties();
686 layer_tree_impl()->AddToTransformAnimationsMap(id(), transform);
ajuma 2016/06/01 15:14:55 I think this needs to happen even when old_transfo
jaydasika 2016/06/01 16:29:09 Done.
687 layer_tree_impl()->set_needs_update_draw_properties(); 687 layer_tree_impl()->set_needs_update_draw_properties();
688 } 688 }
689 } 689 }
690 690
691 void LayerImpl::OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) { 691 void LayerImpl::OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) {
692 // Only layers in the active tree should need to do anything here, since 692 // Only layers in the active tree should need to do anything here, since
693 // layers in the pending tree will find out about these changes as a 693 // layers in the pending tree will find out about these changes as a
694 // result of the shared SyncedProperty. 694 // result of the shared SyncedProperty.
695 if (!IsActive()) 695 if (!IsActive())
696 return; 696 return;
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 .layer_transforms_should_scale_layer_contents) { 1340 .layer_transforms_should_scale_layer_contents) {
1341 return default_scale; 1341 return default_scale;
1342 } 1342 }
1343 1343
1344 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( 1344 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents(
1345 ScreenSpaceTransform(), default_scale); 1345 ScreenSpaceTransform(), default_scale);
1346 return std::max(transform_scales.x(), transform_scales.y()); 1346 return std::max(transform_scales.x(), transform_scales.y());
1347 } 1347 }
1348 1348
1349 } // namespace cc 1349 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698