| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 TransformPaintPropertyNode_h | 5 #ifndef TransformPaintPropertyNode_h |
| 6 #define TransformPaintPropertyNode_h | 6 #define TransformPaintPropertyNode_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/geometry/FloatPoint3D.h" | 9 #include "platform/geometry/FloatPoint3D.h" |
| 10 #include "platform/transforms/TransformationMatrix.h" | 10 #include "platform/transforms/TransformationMatrix.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 unsigned renderingContextID = 0) { | 42 unsigned renderingContextID = 0) { |
| 43 DCHECK(!isRoot()); | 43 DCHECK(!isRoot()); |
| 44 DCHECK(parent != this); | 44 DCHECK(parent != this); |
| 45 m_parent = parent; | 45 m_parent = parent; |
| 46 m_matrix = matrix; | 46 m_matrix = matrix; |
| 47 m_origin = origin; | 47 m_origin = origin; |
| 48 m_flattensInheritedTransform = flattensInheritedTransform; | 48 m_flattensInheritedTransform = flattensInheritedTransform; |
| 49 m_renderingContextID = renderingContextID; | 49 m_renderingContextID = renderingContextID; |
| 50 } | 50 } |
| 51 | 51 |
| 52 PassRefPtr<TransformPaintPropertyNode> clone() const { |
| 53 return adoptRef(new TransformPaintPropertyNode(m_matrix, m_origin, m_parent, |
| 54 m_flattensInheritedTransform, |
| 55 m_renderingContextID)); |
| 56 } |
| 57 |
| 58 bool operator==(const TransformPaintPropertyNode& o) const { |
| 59 return m_matrix == o.m_matrix && m_origin == o.m_origin && |
| 60 m_parent == o.m_parent && |
| 61 m_flattensInheritedTransform == o.m_flattensInheritedTransform && |
| 62 m_renderingContextID == o.m_renderingContextID; |
| 63 } |
| 64 |
| 52 const TransformationMatrix& matrix() const { return m_matrix; } | 65 const TransformationMatrix& matrix() const { return m_matrix; } |
| 53 const FloatPoint3D& origin() const { return m_origin; } | 66 const FloatPoint3D& origin() const { return m_origin; } |
| 54 | 67 |
| 55 // Parent transform that this transform is relative to, or nullptr if this | 68 // Parent transform that this transform is relative to, or nullptr if this |
| 56 // is the root transform. | 69 // is the root transform. |
| 57 const TransformPaintPropertyNode* parent() const { return m_parent.get(); } | 70 const TransformPaintPropertyNode* parent() const { return m_parent.get(); } |
| 58 bool isRoot() const { return !m_parent; } | 71 bool isRoot() const { return !m_parent; } |
| 59 | 72 |
| 60 // If true, content with this transform node (or its descendant) appears in | 73 // If true, content with this transform node (or its descendant) appears in |
| 61 // the plane of its parent. This is implemented by flattening the total | 74 // the plane of its parent. This is implemented by flattening the total |
| (...skipping 27 matching lines...) Expand all Loading... |
| 89 unsigned m_renderingContextID; | 102 unsigned m_renderingContextID; |
| 90 }; | 103 }; |
| 91 | 104 |
| 92 // Redeclared here to avoid ODR issues. | 105 // Redeclared here to avoid ODR issues. |
| 93 // See platform/testing/PaintPrinters.h. | 106 // See platform/testing/PaintPrinters.h. |
| 94 void PrintTo(const TransformPaintPropertyNode&, std::ostream*); | 107 void PrintTo(const TransformPaintPropertyNode&, std::ostream*); |
| 95 | 108 |
| 96 } // namespace blink | 109 } // namespace blink |
| 97 | 110 |
| 98 #endif // TransformPaintPropertyNode_h | 111 #endif // TransformPaintPropertyNode_h |
| OLD | NEW |