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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 // corresponding Layer at the time of the last commit. For example, if | 532 // corresponding Layer at the time of the last commit. For example, if |
533 // |is_animated| is false, this might mean a transform animation just ticked | 533 // |is_animated| is false, this might mean a transform animation just ticked |
534 // past its finish point (so the LayerImpl still owns a TransformNode) or it | 534 // past its finish point (so the LayerImpl still owns a TransformNode) or it |
535 // might mean that a transform animation was removed during commit or | 535 // might mean that a transform animation was removed during commit or |
536 // activation (and, in that case, the LayerImpl will no longer own a | 536 // activation (and, in that case, the LayerImpl will no longer own a |
537 // TransformNode, unless it has non-animation-related reasons for owning a | 537 // TransformNode, unless it has non-animation-related reasons for owning a |
538 // node). | 538 // node). |
539 if (node->data.has_potential_animation != is_animated) { | 539 if (node->data.has_potential_animation != is_animated) { |
540 node->data.has_potential_animation = is_animated; | 540 node->data.has_potential_animation = is_animated; |
541 if (is_animated) { | 541 if (is_animated) { |
542 float maximum_target_scale = 0.f; | |
543 node->data.local_maximum_animation_target_scale = | |
544 MaximumTargetScale(&maximum_target_scale) ? maximum_target_scale | |
545 : 0.f; | |
546 | |
547 float animation_start_scale = 0.f; | |
548 node->data.local_starting_animation_scale = | |
549 AnimationStartScale(&animation_start_scale) ? animation_start_scale | |
550 : 0.f; | |
551 | |
552 node->data.has_only_translation_animations = | 542 node->data.has_only_translation_animations = |
553 HasOnlyTranslationTransforms(); | 543 HasOnlyTranslationTransforms(); |
554 } else { | 544 } else { |
555 node->data.local_maximum_animation_target_scale = 0.f; | |
556 node->data.local_starting_animation_scale = 0.f; | |
557 node->data.has_only_translation_animations = true; | 545 node->data.has_only_translation_animations = true; |
558 } | 546 } |
559 | 547 |
560 property_trees->transform_tree.set_needs_update(true); | 548 property_trees->transform_tree.set_needs_update(true); |
561 layer_tree_impl()->set_needs_update_draw_properties(); | 549 layer_tree_impl()->set_needs_update_draw_properties(); |
562 } | 550 } |
563 } | 551 } |
564 } | 552 } |
565 | 553 |
566 void LayerImpl::UpdatePropertyTreeOpacity(float opacity) { | 554 void LayerImpl::UpdatePropertyTreeOpacity(float opacity) { |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 .layer_transforms_should_scale_layer_contents) { | 1195 .layer_transforms_should_scale_layer_contents) { |
1208 return default_scale; | 1196 return default_scale; |
1209 } | 1197 } |
1210 | 1198 |
1211 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( | 1199 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( |
1212 ScreenSpaceTransform(), default_scale); | 1200 ScreenSpaceTransform(), default_scale); |
1213 return std::max(transform_scales.x(), transform_scales.y()); | 1201 return std::max(transform_scales.x(), transform_scales.y()); |
1214 } | 1202 } |
1215 | 1203 |
1216 } // namespace cc | 1204 } // namespace cc |
OLD | NEW |