OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/compositor/transform_animation_curve_adapter.h" | 5 #include "ui/compositor/transform_animation_curve_adapter.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "cc/base/time_util.h" | 8 #include "cc/base/time_util.h" |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 bool TransformAnimationCurveAdapter::AnimatedBoundsForBox( | 58 bool TransformAnimationCurveAdapter::AnimatedBoundsForBox( |
59 const gfx::BoxF& box, | 59 const gfx::BoxF& box, |
60 gfx::BoxF* bounds) const { | 60 gfx::BoxF* bounds) const { |
61 // TODO(ajuma): Once cc::TransformOperation::BlendedBoundsForBox supports | 61 // TODO(ajuma): Once cc::TransformOperation::BlendedBoundsForBox supports |
62 // computing bounds for TransformOperationMatrix, use that to compute | 62 // computing bounds for TransformOperationMatrix, use that to compute |
63 // the bounds we need here. | 63 // the bounds we need here. |
64 return false; | 64 return false; |
65 } | 65 } |
66 | 66 |
67 bool TransformAnimationCurveAdapter::AffectsScale() const { | |
68 return !initial_value_.IsIdentityOrTranslation() || | |
69 !target_value_.IsIdentityOrTranslation(); | |
70 } | |
71 | |
72 bool TransformAnimationCurveAdapter::IsTranslation() const { | 67 bool TransformAnimationCurveAdapter::IsTranslation() const { |
73 return initial_value_.IsIdentityOrTranslation() && | 68 return initial_value_.IsIdentityOrTranslation() && |
74 target_value_.IsIdentityOrTranslation(); | 69 target_value_.IsIdentityOrTranslation(); |
75 } | 70 } |
76 | 71 |
77 bool TransformAnimationCurveAdapter::PreservesAxisAlignment() const { | 72 bool TransformAnimationCurveAdapter::PreservesAxisAlignment() const { |
78 return (initial_value_.IsIdentity() || | 73 return (initial_value_.IsIdentity() || |
79 initial_value_.IsScaleOrTranslation()) && | 74 initial_value_.IsScaleOrTranslation()) && |
80 (target_value_.IsIdentity() || target_value_.IsScaleOrTranslation()); | 75 (target_value_.IsIdentity() || target_value_.IsScaleOrTranslation()); |
81 } | 76 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 127 |
133 bool InverseTransformCurveAdapter::AnimatedBoundsForBox( | 128 bool InverseTransformCurveAdapter::AnimatedBoundsForBox( |
134 const gfx::BoxF& box, | 129 const gfx::BoxF& box, |
135 gfx::BoxF* bounds) const { | 130 gfx::BoxF* bounds) const { |
136 // TODO(ajuma): Once cc::TransformOperation::BlendedBoundsForBox supports | 131 // TODO(ajuma): Once cc::TransformOperation::BlendedBoundsForBox supports |
137 // computing bounds for TransformOperationMatrix, use that to compute | 132 // computing bounds for TransformOperationMatrix, use that to compute |
138 // the bounds we need here. | 133 // the bounds we need here. |
139 return false; | 134 return false; |
140 } | 135 } |
141 | 136 |
142 bool InverseTransformCurveAdapter::AffectsScale() const { | |
143 return !initial_value_.IsIdentityOrTranslation() || | |
144 base_curve_.AffectsScale(); | |
145 } | |
146 | |
147 bool InverseTransformCurveAdapter::IsTranslation() const { | 137 bool InverseTransformCurveAdapter::IsTranslation() const { |
148 return initial_value_.IsIdentityOrTranslation() && | 138 return initial_value_.IsIdentityOrTranslation() && |
149 base_curve_.IsTranslation(); | 139 base_curve_.IsTranslation(); |
150 } | 140 } |
151 | 141 |
152 bool InverseTransformCurveAdapter::PreservesAxisAlignment() const { | 142 bool InverseTransformCurveAdapter::PreservesAxisAlignment() const { |
153 return (initial_value_.IsIdentity() || | 143 return (initial_value_.IsIdentity() || |
154 initial_value_.IsScaleOrTranslation()) && | 144 initial_value_.IsScaleOrTranslation()) && |
155 (base_curve_.PreservesAxisAlignment()); | 145 (base_curve_.PreservesAxisAlignment()); |
156 } | 146 } |
157 | 147 |
158 bool InverseTransformCurveAdapter::AnimationStartScale( | 148 bool InverseTransformCurveAdapter::AnimationStartScale( |
159 bool forward_direction, | 149 bool forward_direction, |
160 float* start_scale) const { | 150 float* start_scale) const { |
161 return false; | 151 return false; |
162 } | 152 } |
163 | 153 |
164 bool InverseTransformCurveAdapter::MaximumTargetScale(bool forward_direction, | 154 bool InverseTransformCurveAdapter::MaximumTargetScale(bool forward_direction, |
165 float* max_scale) const { | 155 float* max_scale) const { |
166 return false; | 156 return false; |
167 } | 157 } |
168 | 158 |
169 } // namespace ui | 159 } // namespace ui |
OLD | NEW |