| 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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 if (HasAnyAnimationTargetingProperty(TargetProperty::TRANSFORM)) { | 535 if (HasAnyAnimationTargetingProperty(TargetProperty::TRANSFORM)) { |
| 536 UpdatePropertyTreeTransformIsAnimated( | 536 UpdatePropertyTreeTransformIsAnimated( |
| 537 HasPotentiallyRunningTransformAnimation()); | 537 HasPotentiallyRunningTransformAnimation()); |
| 538 } | 538 } |
| 539 } | 539 } |
| 540 | 540 |
| 541 gfx::ScrollOffset LayerImpl::ScrollOffsetForAnimation() const { | 541 gfx::ScrollOffset LayerImpl::ScrollOffsetForAnimation() const { |
| 542 return CurrentScrollOffset(); | 542 return CurrentScrollOffset(); |
| 543 } | 543 } |
| 544 | 544 |
| 545 void LayerImpl::OnFilterAnimated(const FilterOperations& filters) { | |
| 546 layer_tree_impl()->AddToFilterAnimationsMap(id(), filters); | |
| 547 PropertyTrees* property_trees = layer_tree_impl()->property_trees(); | |
| 548 DCHECK( | |
| 549 property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id())); | |
| 550 EffectNode* node = property_trees->effect_tree.Node(effect_tree_index()); | |
| 551 if (node->filters == filters) | |
| 552 return; | |
| 553 node->filters = filters; | |
| 554 node->effect_changed = true; | |
| 555 property_trees->changed = true; | |
| 556 property_trees->effect_tree.set_needs_update(true); | |
| 557 SetNeedsPushProperties(); | |
| 558 layer_tree_impl()->set_needs_update_draw_properties(); | |
| 559 } | |
| 560 | |
| 561 void LayerImpl::OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) { | 545 void LayerImpl::OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) { |
| 562 // Only layers in the active tree should need to do anything here, since | 546 // Only layers in the active tree should need to do anything here, since |
| 563 // layers in the pending tree will find out about these changes as a | 547 // layers in the pending tree will find out about these changes as a |
| 564 // result of the shared SyncedProperty. | 548 // result of the shared SyncedProperty. |
| 565 if (!IsActive()) | 549 if (!IsActive()) |
| 566 return; | 550 return; |
| 567 | 551 |
| 568 SetCurrentScrollOffset(ClampScrollOffsetToLimits(scroll_offset)); | 552 SetCurrentScrollOffset(ClampScrollOffsetToLimits(scroll_offset)); |
| 569 | 553 |
| 570 layer_tree_impl_->DidAnimateScrollOffset(); | 554 layer_tree_impl_->DidAnimateScrollOffset(); |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1135 .layer_transforms_should_scale_layer_contents) { | 1119 .layer_transforms_should_scale_layer_contents) { |
| 1136 return default_scale; | 1120 return default_scale; |
| 1137 } | 1121 } |
| 1138 | 1122 |
| 1139 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( | 1123 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( |
| 1140 ScreenSpaceTransform(), default_scale); | 1124 ScreenSpaceTransform(), default_scale); |
| 1141 return std::max(transform_scales.x(), transform_scales.y()); | 1125 return std::max(transform_scales.x(), transform_scales.y()); |
| 1142 } | 1126 } |
| 1143 | 1127 |
| 1144 } // namespace cc | 1128 } // namespace cc |
| OLD | NEW |