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

Unified Diff: third_party/WebKit/Source/core/paint/ObjectPaintProperties.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
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/paint/PaintLayer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
diff --git a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
new file mode 100644
index 0000000000000000000000000000000000000000..5bce0886dd627a31c625c2b97bb204dfc29e7108
--- /dev/null
+++ b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
@@ -0,0 +1,49 @@
+// 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 ObjectPaintProperties_h
+#define ObjectPaintProperties_h
+
+#include "platform/graphics/paint/TransformPaintPropertyNode.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
+
+namespace blink {
+
+// The minimal set of paint properties created by a |LayoutObject|. These
+// properties encode a hierachy of transforms, clips, effects, etc, both between
+// LayoutObjects (each property has a parent) and among the properties of a
+// single LayoutObject (e.g., transform and perspective with the correct parent
+// relationship to represent ordering).
+//
+// This differs from |PaintChunkProperties| because it can store multiple
+// properties of the same type (e.g., transform and perspective which are both
+// transforms).
+class ObjectPaintProperties {
+ WTF_MAKE_NONCOPYABLE(ObjectPaintProperties);
+ WTF_MAKE_FAST_ALLOCATED(ObjectPaintProperties);
+public:
+ static PassOwnPtr<ObjectPaintProperties> create()
+ {
+ return adoptPtr(new ObjectPaintProperties());
+ }
+
+ bool hasTransform() const { return m_transform; }
+ void setTransform(PassRefPtr<TransformPaintPropertyNode> transform) { m_transform = transform; }
+ const TransformPaintPropertyNode* transform() const { return m_transform.get(); }
+
+ bool hasPerspective() const { return m_perspective; }
+ void setPerspective(PassRefPtr<TransformPaintPropertyNode> perspective) { m_perspective = perspective; }
+ const TransformPaintPropertyNode* perspective() const { return m_perspective.get(); }
+
+private:
+ ObjectPaintProperties() { }
+
+ RefPtr<TransformPaintPropertyNode> m_transform;
+ RefPtr<TransformPaintPropertyNode> m_perspective;
+};
+
+} // namespace blink
+
+#endif // ObjectPaintProperties_h
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/paint/PaintLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698