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

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

Issue 1397583002: Implement the framework for a paint property hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Job insecurity: better tests, better comments, better names. Created 5 years, 2 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
new file mode 100644
index 0000000000000000000000000000000000000000..e656dc8bf1180f32a0d8724275b4823ac6341e67
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.h
@@ -0,0 +1,46 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef TransformPaintPropertyNode_h
+#define TransformPaintPropertyNode_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/FloatPoint3D.h"
+#include "platform/transforms/TransformationMatrix.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/RefPtr.h"
+
+#include <iosfwd>
+
+namespace blink {
+
+// A transform created by a css property such as "transform" or "perspective"
+// along with a reference to the parent TransformPaintPropertyNode, or nullptr
+// for the root.
+class PLATFORM_EXPORT TransformPaintPropertyNode : public RefCounted<TransformPaintPropertyNode> {
+public:
+ TransformPaintPropertyNode(const TransformationMatrix& matrix, const FloatPoint3D& origin, PassRefPtr<TransformPaintPropertyNode> parent = nullptr)
+ : m_matrix(matrix), m_origin(origin), m_parent(parent) { }
+
+ const TransformationMatrix& matrix() const { return m_matrix; }
+ const FloatPoint3D& origin() const { return m_origin; }
+
+ // Parent transform that this transform is relative to, or nullptr if this
+ // is the root transform.
+ const TransformPaintPropertyNode* parent() const { return m_parent.get(); }
+
+private:
+ const TransformationMatrix m_matrix;
+ const FloatPoint3D m_origin;
+ RefPtr<TransformPaintPropertyNode> m_parent;
+};
+
+// Redeclared here to avoid ODR issues.
+// See platform/testing/PaintPrinters.h.
+void PrintTo(const TransformPaintPropertyNode&, std::ostream*);
+
+} // namespace blink
+
+#endif // TransformPaintPropertyNode_h

Powered by Google App Engine
This is Rietveld 408576698