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

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

Issue 2565073002: Implement the algorithm to test merging and overlap in PaintArtifactCompositor. (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 6a6f1e2eabc3cdfe92fe78ec554645933f14b608..a3116582bad6fd18d567ef3d521ef4c3c37b83b1 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.h
@@ -68,12 +68,67 @@ class PropertyTreeState {
DCHECK(!node->hasOneRef());
}
+ bool hasDirectCompositingReasons() const {
+ if (!m_transform->isRoot() &&
+ m_clip->localTransformSpace() != m_transform) {
+ return m_transform->hasDirectCompositingReasons();
+ }
+ return false;
+ }
+
private:
RefPtr<const TransformPaintPropertyNode> m_transform;
RefPtr<const ClipPaintPropertyNode> m_clip;
RefPtr<const EffectPaintPropertyNode> m_effect;
RefPtr<const ScrollPaintPropertyNode> m_scroll;
};
+
+class PropertyTreeStateIterator {
+ public:
+ PropertyTreeStateIterator(const PropertyTreeState& properties)
+ : m_properties(properties) {}
+
+ const PropertyTreeState& current() { return m_properties; }
+ void next() {
+ if (!m_properties.transform()->isRoot() &&
+ m_properties.clip()->localTransformSpace() !=
+ m_properties.transform()) {
+ m_properties.setTransform(m_properties.transform()->parent());
+ }
+ if (!m_properties.effect()->isRoot() &&
+ m_properties.effect()->outputClip() == m_properties.clip()) {
+ m_properties.setEffect(m_properties.effect()->parent());
+ }
+ if (!m_properties.clip()->isRoot()) {
+ m_properties.setClip(m_properties.clip()->parent());
+ }
+ }
+
+ bool hasNext() {
+ if (!m_properties.transform()->isRoot() &&
+ m_properties.clip()->localTransformSpace() !=
+ m_properties.transform()) {
+ return true;
+ }
+ if (!m_properties.effect()->isRoot() &&
+ m_properties.effect()->outputClip() == m_properties.clip()) {
+ return true;
+ }
+ if (!m_properties.clip()->isRoot()) {
+ return true;
+ }
+ return false;
+ }
+
+ private:
+ PropertyTreeState m_properties;
+};
+
+inline bool operator==(const PropertyTreeState& a, const PropertyTreeState& b) {
+ return a.transform() == b.transform() && a.clip() == b.clip() &&
+ a.effect() == b.effect() && a.scroll() == b.scroll();
+}
+
} // namespace blink
#endif // PropertyTreeState_h

Powered by Google App Engine
This is Rietveld 408576698