Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1023)

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h

Issue 2144823006: Reuse existing paint property node is possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..1481e60d7c64ce13a5e2294415e9a1fcd59defaf 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h
@@ -21,9 +21,16 @@ namespace blink {
// for the root.
class PLATFORM_EXPORT TransformPaintPropertyNode : public RefCounted<TransformPaintPropertyNode> {
public:
- static PassRefPtr<TransformPaintPropertyNode> create(const TransformationMatrix& matrix, const FloatPoint3D& origin, PassRefPtr<TransformPaintPropertyNode> parent = nullptr)
+ static PassRefPtr<TransformPaintPropertyNode> create(PassRefPtr<TransformPaintPropertyNode> parent, const TransformationMatrix& matrix, const FloatPoint3D& origin)
{
- return adoptRef(new TransformPaintPropertyNode(matrix, origin, parent));
+ return adoptRef(new TransformPaintPropertyNode(parent, matrix, origin));
+ }
+
+ void update(PassRefPtr<TransformPaintPropertyNode> parent, const TransformationMatrix& matrix, const FloatPoint3D& origin)
+ {
+ m_parent = parent;
+ m_matrix = matrix;
+ m_origin = origin;
}
const TransformationMatrix& matrix() const { return m_matrix; }
@@ -34,13 +41,12 @@ public:
TransformPaintPropertyNode* parent() const { return m_parent.get(); }
private:
+ TransformPaintPropertyNode(PassRefPtr<TransformPaintPropertyNode> parent, const TransformationMatrix& matrix, const FloatPoint3D& origin)
+ : m_parent(parent), m_matrix(matrix), m_origin(origin) { }
- TransformPaintPropertyNode(const TransformationMatrix& matrix, const FloatPoint3D& origin, PassRefPtr<TransformPaintPropertyNode> parent)
- : m_matrix(matrix), m_origin(origin), m_parent(parent) { }
-
- const TransformationMatrix m_matrix;
- const FloatPoint3D m_origin;
RefPtr<TransformPaintPropertyNode> m_parent;
+ TransformationMatrix m_matrix;
+ FloatPoint3D m_origin;
};
// Redeclared here to avoid ODR issues.

Powered by Google App Engine
This is Rietveld 408576698