Index: third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h |
diff --git a/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h b/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h |
index 03980087c1c8c198b83549a2574fbd84142fa8b2..2c4af5f7c4e4ac6652fa2faeee09b2552dc4eb6d 100644 |
--- a/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h |
+++ b/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h |
@@ -21,25 +21,42 @@ namespace blink { |
// for the root. |
class PLATFORM_EXPORT TransformPaintPropertyNode : public RefCounted<TransformPaintPropertyNode> { |
public: |
+ struct Value { |
+ Value() { } |
+ Value(const TransformationMatrix& matrix, const FloatPoint3D& origin) : matrix(matrix), origin(origin) { } |
+ bool operator ==(const Value& other) const { return matrix == other.matrix && origin == other.origin; } |
pdr.
2016/07/21 21:34:07
Nit: no space between operator and ==
Xianzhu
2016/07/22 01:14:05
No more applicable.
|
+ |
+ TransformationMatrix matrix; |
+ FloatPoint3D origin; |
+ }; |
+ |
static PassRefPtr<TransformPaintPropertyNode> create(const TransformationMatrix& matrix, const FloatPoint3D& origin, PassRefPtr<TransformPaintPropertyNode> parent = nullptr) |
{ |
- return adoptRef(new TransformPaintPropertyNode(matrix, origin, parent)); |
+ return adoptRef(new TransformPaintPropertyNode(Value(matrix, origin), parent)); |
} |
- const TransformationMatrix& matrix() const { return m_matrix; } |
- const FloatPoint3D& origin() const { return m_origin; } |
+ // This form is required by PaintPropertyTreeBuilder::updateObjectPaintProperties(). |
+ static PassRefPtr<TransformPaintPropertyNode> create(const Value& value, PassRefPtr<TransformPaintPropertyNode> parent) |
+ { |
+ return adoptRef(new TransformPaintPropertyNode(value, parent)); |
+ } |
+ |
+ const Value& value() const { return m_value; } |
+ const TransformationMatrix& matrix() const { return m_value.matrix; } |
+ const FloatPoint3D& origin() const { return m_value.origin; } |
// Parent transform that this transform is relative to, or nullptr if this |
// is the root transform. |
TransformPaintPropertyNode* parent() const { return m_parent.get(); } |
-private: |
+ // Moves this node and its subtrees under another parent. |
+ void setParent(PassRefPtr<TransformPaintPropertyNode> parent) { m_parent = parent; } |
pdr.
2016/07/21 21:34:07
What do you think of restricting setters to PaintP
Xianzhu
2016/07/22 01:14:05
Changed this to update() method. I think 'const' i
|
- TransformPaintPropertyNode(const TransformationMatrix& matrix, const FloatPoint3D& origin, PassRefPtr<TransformPaintPropertyNode> parent) |
- : m_matrix(matrix), m_origin(origin), m_parent(parent) { } |
+private: |
+ TransformPaintPropertyNode(const Value& value, PassRefPtr<TransformPaintPropertyNode> parent) |
+ : m_value(value), m_parent(parent) { } |
- const TransformationMatrix m_matrix; |
- const FloatPoint3D m_origin; |
+ Value m_value; |
RefPtr<TransformPaintPropertyNode> m_parent; |
}; |