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

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

Issue 2581843002: Implement merging non-composited paint property nodes in the PACompositor. (Closed)
Patch Set: none Created 4 years 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/PropertyTreeState.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.h b/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.h
index c59fc27f16496f21a0052eded86c7f093ef9d3da..906e188633c626bc7342cdf575295004d839e999 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.h
@@ -18,7 +18,7 @@ namespace blink {
// other objects. RefPtrs are used to guard against use-after-free bugs and
// DCHECKs ensure PropertyTreeState never retains the last reference to a
// property tree node.
-class PropertyTreeState {
+class PLATFORM_EXPORT PropertyTreeState {
public:
PropertyTreeState(const TransformPaintPropertyNode* transform,
const ClipPaintPropertyNode* clip,
@@ -34,6 +34,8 @@ class PropertyTreeState {
DCHECK(!m_scroll || !m_scroll->hasOneRef());
}
+ bool hasDirectCompositingReasons() const;
+
const TransformPaintPropertyNode* transform() const {
DCHECK(!m_transform || !m_transform->hasOneRef());
return m_transform.get();
@@ -66,6 +68,18 @@ class PropertyTreeState {
m_scroll = std::move(node);
}
+ enum InnermostNode {
+ None, // None means that all nodes are their root values
+ Transform,
+ Clip,
+ Effect,
+ };
+
+ // There is always a well-defined order in which the transform, clip
+ // and effect of a PropertyTreeState apply. This method returns which
+ // of them applies first.
+ InnermostNode innermostNode() const;
+
private:
RefPtr<const TransformPaintPropertyNode> m_transform;
RefPtr<const ClipPaintPropertyNode> m_clip;
@@ -78,6 +92,20 @@ inline bool operator==(const PropertyTreeState& a, const PropertyTreeState& b) {
a.effect() == b.effect() && a.scroll() == b.scroll();
}
+// Iterates over the sequence transforms, clips and effects for a
+// PropertyTreeState
+// between that state and the "root" state (all nodes equal to *::Root()),
+// in the order that they apply.
+class PLATFORM_EXPORT PropertyTreeStateIterator {
+ public:
+ PropertyTreeStateIterator(const PropertyTreeState& properties)
+ : m_properties(properties) {}
+ const PropertyTreeState* next();
+
+ private:
+ PropertyTreeState m_properties;
+};
+
} // namespace blink
#endif // PropertyTreeState_h

Powered by Google App Engine
This is Rietveld 408576698