| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CompositorTransformOperations_h | 5 #ifndef CompositorTransformOperations_h |
| 6 #define CompositorTransformOperations_h | 6 #define CompositorTransformOperations_h |
| 7 | 7 |
| 8 #include "cc/animation/transform_operations.h" | 8 #include "cc/animation/transform_operations.h" |
| 9 #include "platform/PlatformExport.h" | 9 #include "platform/PlatformExport.h" |
| 10 #include "wtf/Noncopyable.h" | 10 #include "wtf/Noncopyable.h" |
| 11 #include "wtf/PassOwnPtr.h" | 11 #include "wtf/PtrUtil.h" |
| 12 #include <memory> |
| 12 | 13 |
| 13 class SkMatrix44; | 14 class SkMatrix44; |
| 14 | 15 |
| 15 namespace blink { | 16 namespace blink { |
| 16 | 17 |
| 17 class PLATFORM_EXPORT CompositorTransformOperations { | 18 class PLATFORM_EXPORT CompositorTransformOperations { |
| 18 WTF_MAKE_NONCOPYABLE(CompositorTransformOperations); | 19 WTF_MAKE_NONCOPYABLE(CompositorTransformOperations); |
| 19 public: | 20 public: |
| 20 static PassOwnPtr<CompositorTransformOperations> create() | 21 static std::unique_ptr<CompositorTransformOperations> create() |
| 21 { | 22 { |
| 22 return adoptPtr(new CompositorTransformOperations()); | 23 return wrapUnique(new CompositorTransformOperations()); |
| 23 } | 24 } |
| 24 | 25 |
| 25 const cc::TransformOperations& asTransformOperations() const; | 26 const cc::TransformOperations& asTransformOperations() const; |
| 26 | 27 |
| 27 // Returns true if these operations can be blended. It will only return | 28 // Returns true if these operations can be blended. It will only return |
| 28 // false if we must resort to matrix interpolation, and matrix interpolation | 29 // false if we must resort to matrix interpolation, and matrix interpolation |
| 29 // fails (this can happen if either matrix cannot be decomposed). | 30 // fails (this can happen if either matrix cannot be decomposed). |
| 30 bool canBlendWith(const CompositorTransformOperations& other) const; | 31 bool canBlendWith(const CompositorTransformOperations& other) const; |
| 31 | 32 |
| 32 void appendTranslate(double x, double y, double z); | 33 void appendTranslate(double x, double y, double z); |
| 33 void appendRotate(double x, double y, double z, double degrees); | 34 void appendRotate(double x, double y, double z, double degrees); |
| 34 void appendScale(double x, double y, double z); | 35 void appendScale(double x, double y, double z); |
| 35 void appendSkew(double x, double y); | 36 void appendSkew(double x, double y); |
| 36 void appendPerspective(double depth); | 37 void appendPerspective(double depth); |
| 37 void appendMatrix(const SkMatrix44&); | 38 void appendMatrix(const SkMatrix44&); |
| 38 void appendIdentity(); | 39 void appendIdentity(); |
| 39 | 40 |
| 40 bool isIdentity() const; | 41 bool isIdentity() const; |
| 41 | 42 |
| 42 private: | 43 private: |
| 43 CompositorTransformOperations(); | 44 CompositorTransformOperations(); |
| 44 | 45 |
| 45 cc::TransformOperations m_transformOperations; | 46 cc::TransformOperations m_transformOperations; |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 } // namespace blink | 49 } // namespace blink |
| 49 | 50 |
| 50 #endif // CompositorTransformOperations_h | 51 #endif // CompositorTransformOperations_h |
| OLD | NEW |