| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CC_ANIMATION_TRANSFORM_OPERATIONS_H_ | 5 #ifndef CC_ANIMATION_TRANSFORM_OPERATIONS_H_ |
| 6 #define CC_ANIMATION_TRANSFORM_OPERATIONS_H_ | 6 #define CC_ANIMATION_TRANSFORM_OPERATIONS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "cc/animation/animation_export.h" |
| 13 #include "cc/animation/transform_operation.h" | 14 #include "cc/animation/transform_operation.h" |
| 14 #include "cc/base/cc_export.h" | |
| 15 #include "ui/gfx/transform.h" | 15 #include "ui/gfx/transform.h" |
| 16 | 16 |
| 17 namespace gfx { | 17 namespace gfx { |
| 18 class BoxF; | 18 class BoxF; |
| 19 struct DecomposedTransform; | 19 struct DecomposedTransform; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace cc { | 22 namespace cc { |
| 23 | 23 |
| 24 // Transform operations are a decomposed transformation matrix. It can be | 24 // Transform operations are a decomposed transformation matrix. It can be |
| 25 // applied to obtain a gfx::Transform at any time, and can be blended | 25 // applied to obtain a gfx::Transform at any time, and can be blended |
| 26 // intelligently with other transform operations, so long as they represent the | 26 // intelligently with other transform operations, so long as they represent the |
| 27 // same decomposition. For example, if we have a transform that is made up of | 27 // same decomposition. For example, if we have a transform that is made up of |
| 28 // a rotation followed by skew, it can be blended intelligently with another | 28 // a rotation followed by skew, it can be blended intelligently with another |
| 29 // transform made up of a rotation followed by a skew. Blending is possible if | 29 // transform made up of a rotation followed by a skew. Blending is possible if |
| 30 // we have two dissimilar sets of transform operations, but the effect may not | 30 // we have two dissimilar sets of transform operations, but the effect may not |
| 31 // be what was intended. For more information, see the comments for the blend | 31 // be what was intended. For more information, see the comments for the blend |
| 32 // function below. | 32 // function below. |
| 33 class CC_EXPORT TransformOperations { | 33 class CC_ANIMATION_EXPORT TransformOperations { |
| 34 public: | 34 public: |
| 35 TransformOperations(); | 35 TransformOperations(); |
| 36 TransformOperations(const TransformOperations& other); | 36 TransformOperations(const TransformOperations& other); |
| 37 ~TransformOperations(); | 37 ~TransformOperations(); |
| 38 | 38 |
| 39 // Returns a transformation matrix representing these transform operations. | 39 // Returns a transformation matrix representing these transform operations. |
| 40 gfx::Transform Apply() const; | 40 gfx::Transform Apply() const; |
| 41 | 41 |
| 42 // Given another set of transform operations and a progress in the range | 42 // Given another set of transform operations and a progress in the range |
| 43 // [0, 1], returns a transformation matrix representing the intermediate | 43 // [0, 1], returns a transformation matrix representing the intermediate |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // For efficiency, we cache the decomposed transform. | 107 // For efficiency, we cache the decomposed transform. |
| 108 mutable std::unique_ptr<gfx::DecomposedTransform> decomposed_transform_; | 108 mutable std::unique_ptr<gfx::DecomposedTransform> decomposed_transform_; |
| 109 mutable bool decomposed_transform_dirty_; | 109 mutable bool decomposed_transform_dirty_; |
| 110 | 110 |
| 111 DISALLOW_ASSIGN(TransformOperations); | 111 DISALLOW_ASSIGN(TransformOperations); |
| 112 }; | 112 }; |
| 113 | 113 |
| 114 } // namespace cc | 114 } // namespace cc |
| 115 | 115 |
| 116 #endif // CC_ANIMATION_TRANSFORM_OPERATIONS_H_ | 116 #endif // CC_ANIMATION_TRANSFORM_OPERATIONS_H_ |
| OLD | NEW |