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

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

Issue 1390123002: (WIP) Paint property hierarchy approach 1 of 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/TransformPaintProperty.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/TransformPaintProperty.h b/third_party/WebKit/Source/platform/graphics/paint/TransformPaintProperty.h
new file mode 100644
index 0000000000000000000000000000000000000000..d60a917c92f166fbeaa647da15f0d8191dbbd4c1
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/paint/TransformPaintProperty.h
@@ -0,0 +1,42 @@
+// 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 TransformPaintProperty_h
+#define TransformPaintProperty_h
+
+#include "platform/PlatformExport.h"
+#include "platform/geometry/FloatPoint3D.h"
+#include "platform/transforms/TransformationMatrix.h"
+
+#include <iosfwd>
+
+namespace blink {
+
+// A transform created by a css property such as "transform" or "perspective"
+// along with an index for the parent transform property that this transform is
+// relative to (or 0 for the root transform).
+class PLATFORM_EXPORT TransformPaintProperty {
+public:
+ TransformPaintProperty(const TransformationMatrix& matrix, const FloatPoint3D& origin, size_t parentIndex)
+ : m_matrix(matrix), m_origin(origin), m_parentIndex(parentIndex) { };
+
+ const TransformationMatrix& matrix() const { return m_matrix; }
+ const FloatPoint3D& origin() const { return m_origin; }
+
+ // Parent index in the Vector that owns transform paint properties.
+ size_t parentIndex() const { return m_parentIndex; }
+
+private:
+ const TransformationMatrix m_matrix;
+ const FloatPoint3D m_origin;
+ const size_t m_parentIndex;
+};
+
+// Redeclared here to avoid ODR issues.
+// See platform/testing/PaintPrinters.h.
+void PrintTo(const TransformPaintProperty&, std::ostream*);
+
+} // namespace blink
+
+#endif // TransformPaintProperty_h

Powered by Google App Engine
This is Rietveld 408576698