Chromium Code Reviews| 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 13 matching lines...) Expand all Loading... | |
| 24 static PassRefPtr<TransformPaintPropertyNode> create(const TransformationMat rix& matrix, const FloatPoint3D& origin, PassRefPtr<TransformPaintPropertyNode> parent = nullptr) | 24 static PassRefPtr<TransformPaintPropertyNode> create(const TransformationMat rix& matrix, const FloatPoint3D& origin, PassRefPtr<TransformPaintPropertyNode> parent = nullptr) |
| 25 { | 25 { |
| 26 return adoptRef(new TransformPaintPropertyNode(matrix, origin, parent)); | 26 return adoptRef(new TransformPaintPropertyNode(matrix, origin, parent)); |
| 27 } | 27 } |
| 28 | 28 |
| 29 const TransformationMatrix& matrix() const { return m_matrix; } | 29 const TransformationMatrix& matrix() const { return m_matrix; } |
| 30 const FloatPoint3D& origin() const { return m_origin; } | 30 const FloatPoint3D& origin() const { return m_origin; } |
| 31 | 31 |
| 32 // Parent transform that this transform is relative to, or nullptr if this | 32 // Parent transform that this transform is relative to, or nullptr if this |
| 33 // is the root transform. | 33 // is the root transform. |
| 34 const TransformPaintPropertyNode* parent() const { return m_parent.get(); } | 34 TransformPaintPropertyNode* parent() const { return m_parent.get(); } |
| 35 | |
| 36 // Do not use this method if possible, use parent() instead, to preserve con st-ness. | |
| 37 PassRefPtr<TransformPaintPropertyNode> parentRef() const { return m_parent; } | |
|
chrishtr
2016/06/30 16:49:55
Needed so that we can store a refptr to a parent i
pdr.
2016/06/30 21:21:50
This doesn't appear to be used in this patch.
chrishtr
2016/07/01 17:52:24
Removed. The test was crashing due to refptr count
| |
| 35 | 38 |
| 36 private: | 39 private: |
| 40 | |
| 37 TransformPaintPropertyNode(const TransformationMatrix& matrix, const FloatPo int3D& origin, PassRefPtr<TransformPaintPropertyNode> parent) | 41 TransformPaintPropertyNode(const TransformationMatrix& matrix, const FloatPo int3D& origin, PassRefPtr<TransformPaintPropertyNode> parent) |
| 38 : m_matrix(matrix), m_origin(origin), m_parent(parent) { } | 42 : m_matrix(matrix), m_origin(origin), m_parent(parent) { } |
| 39 | 43 |
| 40 const TransformationMatrix m_matrix; | 44 const TransformationMatrix m_matrix; |
| 41 const FloatPoint3D m_origin; | 45 const FloatPoint3D m_origin; |
| 42 RefPtr<TransformPaintPropertyNode> m_parent; | 46 RefPtr<TransformPaintPropertyNode> m_parent; |
| 43 }; | 47 }; |
| 44 | 48 |
| 45 // Redeclared here to avoid ODR issues. | 49 // Redeclared here to avoid ODR issues. |
| 46 // See platform/testing/PaintPrinters.h. | 50 // See platform/testing/PaintPrinters.h. |
| 47 void PrintTo(const TransformPaintPropertyNode&, std::ostream*); | 51 void PrintTo(const TransformPaintPropertyNode&, std::ostream*); |
| 48 | 52 |
| 49 } // namespace blink | 53 } // namespace blink |
| 50 | 54 |
| 51 #endif // TransformPaintPropertyNode_h | 55 #endif // TransformPaintPropertyNode_h |
| OLD | NEW |