Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |