Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: cc/animation/transform_operations.h

Issue 1698213002: Blink Compositor: Erase virtuals on Transform and Filter operations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move AnimationTranslationUtil to platform. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/AnimationTranslationUtil.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <vector> 8 #include <vector>
9 9
10 #include "base/logging.h"
10 #include "base/macros.h" 11 #include "base/macros.h"
11 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
12 #include "cc/animation/transform_operation.h" 13 #include "cc/animation/transform_operation.h"
13 #include "cc/base/cc_export.h" 14 #include "cc/base/cc_export.h"
14 #include "ui/gfx/transform.h" 15 #include "ui/gfx/transform.h"
15 16
16 namespace gfx { 17 namespace gfx {
17 class BoxF; 18 class BoxF;
18 struct DecomposedTransform; 19 struct DecomposedTransform;
19 } 20 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 84
84 void AppendTranslate(SkMScalar x, SkMScalar y, SkMScalar z); 85 void AppendTranslate(SkMScalar x, SkMScalar y, SkMScalar z);
85 void AppendRotate(SkMScalar x, SkMScalar y, SkMScalar z, SkMScalar degrees); 86 void AppendRotate(SkMScalar x, SkMScalar y, SkMScalar z, SkMScalar degrees);
86 void AppendScale(SkMScalar x, SkMScalar y, SkMScalar z); 87 void AppendScale(SkMScalar x, SkMScalar y, SkMScalar z);
87 void AppendSkew(SkMScalar x, SkMScalar y); 88 void AppendSkew(SkMScalar x, SkMScalar y);
88 void AppendPerspective(SkMScalar depth); 89 void AppendPerspective(SkMScalar depth);
89 void AppendMatrix(const gfx::Transform& matrix); 90 void AppendMatrix(const gfx::Transform& matrix);
90 void AppendIdentity(); 91 void AppendIdentity();
91 bool IsIdentity() const; 92 bool IsIdentity() const;
92 93
94 size_t size() const { return operations_.size(); }
95
96 const TransformOperation& at(size_t index) const {
97 DCHECK_LT(index, size());
98 return operations_[index];
99 }
100
93 private: 101 private:
94 bool BlendInternal(const TransformOperations& from, 102 bool BlendInternal(const TransformOperations& from,
95 SkMScalar progress, 103 SkMScalar progress,
96 gfx::Transform* result) const; 104 gfx::Transform* result) const;
97 105
98 std::vector<TransformOperation> operations_; 106 std::vector<TransformOperation> operations_;
99 107
100 bool ComputeDecomposedTransform() const; 108 bool ComputeDecomposedTransform() const;
101 109
102 // For efficiency, we cache the decomposed transform. 110 // For efficiency, we cache the decomposed transform.
103 mutable scoped_ptr<gfx::DecomposedTransform> decomposed_transform_; 111 mutable scoped_ptr<gfx::DecomposedTransform> decomposed_transform_;
104 mutable bool decomposed_transform_dirty_; 112 mutable bool decomposed_transform_dirty_;
105 113
106 DISALLOW_ASSIGN(TransformOperations); 114 DISALLOW_ASSIGN(TransformOperations);
107 }; 115 };
108 116
109 } // namespace cc 117 } // namespace cc
110 118
111 #endif // CC_ANIMATION_TRANSFORM_OPERATIONS_H_ 119 #endif // CC_ANIMATION_TRANSFORM_OPERATIONS_H_
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/AnimationTranslationUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698