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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 777 SetCurrentScrollOffset(ClampScrollOffsetToLimits(scroll_offset)); | 777 SetCurrentScrollOffset(ClampScrollOffsetToLimits(scroll_offset)); |
| 778 | 778 |
| 779 layer_tree_impl_->DidAnimateScrollOffset(); | 779 layer_tree_impl_->DidAnimateScrollOffset(); |
| 780 } | 780 } |
| 781 | 781 |
| 782 void LayerImpl::OnTransformIsPotentiallyAnimatingChanged(bool is_animating) { | 782 void LayerImpl::OnTransformIsPotentiallyAnimatingChanged(bool is_animating) { |
| 783 UpdatePropertyTreeTransformIsAnimated(is_animating); | 783 UpdatePropertyTreeTransformIsAnimated(is_animating); |
| 784 was_ever_ready_since_last_transform_animation_ = false; | 784 was_ever_ready_since_last_transform_animation_ = false; |
| 785 } | 785 } |
| 786 | 786 |
| 787 void LayerImpl::OnOpacityIsCurrentlyAnimatingChanged( | |
| 788 bool is_currently_animating) { | |
| 789 DCHECK(layer_tree_impl_); | |
| 790 EffectTree& effect_tree = layer_tree_impl_->property_trees()->effect_tree; | |
| 791 EffectNode* node = effect_tree.Node(effect_tree_index()); | |
| 792 if (!node) | |
|
ajuma
2016/05/09 16:56:55
Here too, when does the layer have an invalid prop
jaydasika
2016/05/10 20:22:29
In a couple of tests. I have modified those tests
| |
| 793 return; | |
| 794 | |
| 795 if (node->owner_id == id()) | |
| 796 node->data.is_currently_animating_opacity = is_currently_animating; | |
| 797 } | |
| 798 | |
| 799 void LayerImpl::OnOpacityIsPotentiallyAnimatingChanged( | |
| 800 bool has_potential_animation) { | |
| 801 DCHECK(layer_tree_impl_); | |
| 802 EffectTree& effect_tree = layer_tree_impl_->property_trees()->effect_tree; | |
| 803 EffectNode* node = effect_tree.Node(effect_tree_index()); | |
| 804 if (!node) | |
| 805 return; | |
| 806 if (node->owner_id == id()) { | |
| 807 node->data.has_potential_opacity_animation = has_potential_animation; | |
| 808 effect_tree.set_needs_update(true); | |
| 809 } | |
| 810 } | |
| 811 | |
| 787 bool LayerImpl::IsActive() const { | 812 bool LayerImpl::IsActive() const { |
| 788 return layer_tree_impl_->IsActiveTree(); | 813 return layer_tree_impl_->IsActiveTree(); |
| 789 } | 814 } |
| 790 | 815 |
| 791 gfx::Size LayerImpl::bounds() const { | 816 gfx::Size LayerImpl::bounds() const { |
| 792 gfx::Vector2d delta = gfx::ToCeiledVector2d(bounds_delta_); | 817 gfx::Vector2d delta = gfx::ToCeiledVector2d(bounds_delta_); |
| 793 return gfx::Size(bounds_.width() + delta.x(), | 818 return gfx::Size(bounds_.width() + delta.x(), |
| 794 bounds_.height() + delta.y()); | 819 bounds_.height() + delta.y()); |
| 795 } | 820 } |
| 796 | 821 |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1392 .layer_transforms_should_scale_layer_contents) { | 1417 .layer_transforms_should_scale_layer_contents) { |
| 1393 return default_scale; | 1418 return default_scale; |
| 1394 } | 1419 } |
| 1395 | 1420 |
| 1396 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( | 1421 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( |
| 1397 DrawTransform(), default_scale); | 1422 DrawTransform(), default_scale); |
| 1398 return std::max(transform_scales.x(), transform_scales.y()); | 1423 return std::max(transform_scales.x(), transform_scales.y()); |
| 1399 } | 1424 } |
| 1400 | 1425 |
| 1401 } // namespace cc | 1426 } // namespace cc |
| OLD | NEW |