| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // accumulated transform from its ancestors. | 62 // accumulated transform from its ancestors. |
| 63 bool flattensInheritedTransform() const { | 63 bool flattensInheritedTransform() const { |
| 64 return m_flattensInheritedTransform; | 64 return m_flattensInheritedTransform; |
| 65 } | 65 } |
| 66 | 66 |
| 67 // Content whose transform nodes have a common rendering context ID are 3D | 67 // Content whose transform nodes have a common rendering context ID are 3D |
| 68 // sorted. If this is 0, content will not be 3D sorted. | 68 // sorted. If this is 0, content will not be 3D sorted. |
| 69 unsigned renderingContextID() const { return m_renderingContextID; } | 69 unsigned renderingContextID() const { return m_renderingContextID; } |
| 70 bool hasRenderingContext() const { return m_renderingContextID; } | 70 bool hasRenderingContext() const { return m_renderingContextID; } |
| 71 | 71 |
| 72 #if DCHECK_IS_ON() |
| 73 // The clone function is used by FindPropertiesNeedingUpdate.h for recording |
| 74 // a transform node before it has been updated, to later detect changes. |
| 75 PassRefPtr<TransformPaintPropertyNode> clone() const { |
| 76 return adoptRef(new TransformPaintPropertyNode(m_matrix, m_origin, m_parent, |
| 77 m_flattensInheritedTransform, |
| 78 m_renderingContextID)); |
| 79 } |
| 80 |
| 81 // The equality operator is used by FindPropertiesNeedingUpdate.h for checking |
| 82 // if a transform node has changed. |
| 83 bool operator==(const TransformPaintPropertyNode& o) const { |
| 84 return m_matrix == o.m_matrix && m_origin == o.m_origin && |
| 85 m_parent == o.m_parent && |
| 86 m_flattensInheritedTransform == o.m_flattensInheritedTransform && |
| 87 m_renderingContextID == o.m_renderingContextID; |
| 88 } |
| 89 #endif |
| 90 |
| 72 private: | 91 private: |
| 73 TransformPaintPropertyNode( | 92 TransformPaintPropertyNode( |
| 74 const TransformationMatrix& matrix, | 93 const TransformationMatrix& matrix, |
| 75 const FloatPoint3D& origin, | 94 const FloatPoint3D& origin, |
| 76 PassRefPtr<const TransformPaintPropertyNode> parent, | 95 PassRefPtr<const TransformPaintPropertyNode> parent, |
| 77 bool flattensInheritedTransform, | 96 bool flattensInheritedTransform, |
| 78 unsigned renderingContextID) | 97 unsigned renderingContextID) |
| 79 : m_matrix(matrix), | 98 : m_matrix(matrix), |
| 80 m_origin(origin), | 99 m_origin(origin), |
| 81 m_parent(parent), | 100 m_parent(parent), |
| 82 m_flattensInheritedTransform(flattensInheritedTransform), | 101 m_flattensInheritedTransform(flattensInheritedTransform), |
| 83 m_renderingContextID(renderingContextID) {} | 102 m_renderingContextID(renderingContextID) {} |
| 84 | 103 |
| 85 TransformationMatrix m_matrix; | 104 TransformationMatrix m_matrix; |
| 86 FloatPoint3D m_origin; | 105 FloatPoint3D m_origin; |
| 87 RefPtr<const TransformPaintPropertyNode> m_parent; | 106 RefPtr<const TransformPaintPropertyNode> m_parent; |
| 88 bool m_flattensInheritedTransform; | 107 bool m_flattensInheritedTransform; |
| 89 unsigned m_renderingContextID; | 108 unsigned m_renderingContextID; |
| 90 }; | 109 }; |
| 91 | 110 |
| 92 // Redeclared here to avoid ODR issues. | 111 // Redeclared here to avoid ODR issues. |
| 93 // See platform/testing/PaintPrinters.h. | 112 // See platform/testing/PaintPrinters.h. |
| 94 void PrintTo(const TransformPaintPropertyNode&, std::ostream*); | 113 void PrintTo(const TransformPaintPropertyNode&, std::ostream*); |
| 95 | 114 |
| 96 } // namespace blink | 115 } // namespace blink |
| 97 | 116 |
| 98 #endif // TransformPaintPropertyNode_h | 117 #endif // TransformPaintPropertyNode_h |
| OLD | NEW |