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

Unified Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreePrinter.cpp

Issue 2377183002: Add paint property path printers and test them (Closed)
Patch Set: Created 4 years, 3 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/core/paint/PaintPropertyTreePrinter.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinter.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinter.cpp
index 4d0ea45848ddaa1dde180c322713c128e3d38d14..4373acae47ba7c576c55ab9aa79ea96da5900272 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinter.cpp
@@ -41,6 +41,20 @@ public:
return stringBuilder.toString();
}
+ String pathAsString(const PropertyTreeNode* lastNode)
+ {
+ const PropertyTreeNode* node = lastNode;
+ while (!node->isRoot()) {
+ addPropertyNode(node, "");
+ node = node->parent();
+ }
+ addPropertyNode(node, "root");
+
+ StringBuilder stringBuilder;
+ addAllPropertyNodes(stringBuilder, node);
+ return stringBuilder.toString();
+ }
+
void addPropertyNode(const PropertyTreeNode* node, String debugInfo)
{
m_nodeToDebugString.set(node, debugInfo);
@@ -548,6 +562,46 @@ String scrollPropertyTreeAsString(const blink::FrameView& rootFrame)
return blink::PropertyTreePrinter<blink::ScrollPaintPropertyNode>().treeAsString(rootFrame);
}
+String transformPaintPropertyPathAsString(const blink::TransformPaintPropertyNode* node)
+{
+ return blink::PropertyTreePrinter<blink::TransformPaintPropertyNode>().pathAsString(node);
+}
+
+String clipPaintPropertyPathAsString(const blink::ClipPaintPropertyNode* node)
+{
+ return blink::PropertyTreePrinter<blink::ClipPaintPropertyNode>().pathAsString(node);
+}
+
+String effectPaintPropertyPathAsString(const blink::EffectPaintPropertyNode* node)
+{
+ return blink::PropertyTreePrinter<blink::EffectPaintPropertyNode>().pathAsString(node);
+}
+
+String scrollPaintPropertyPathAsString(const blink::ScrollPaintPropertyNode* node)
+{
+ return blink::PropertyTreePrinter<blink::ScrollPaintPropertyNode>().pathAsString(node);
+}
+
+void showPaintPropertyPath(const blink::TransformPaintPropertyNode* node)
+{
+ fprintf(stderr, "%s\n", transformPaintPropertyPathAsString(node).utf8().data());
+}
+
+void showPaintPropertyPath(const blink::ClipPaintPropertyNode* node)
+{
+ fprintf(stderr, "%s\n", clipPaintPropertyPathAsString(node).utf8().data());
+}
+
+void showPaintPropertyPath(const blink::EffectPaintPropertyNode* node)
+{
+ fprintf(stderr, "%s\n", effectPaintPropertyPathAsString(node).utf8().data());
+}
+
+void showPaintPropertyPath(const blink::ScrollPaintPropertyNode* node)
+{
+ fprintf(stderr, "%s\n", scrollPaintPropertyPathAsString(node).utf8().data());
+}
+
String paintPropertyTreeGraph(const blink::FrameView& frameView)
{
blink::PaintPropertyTreeGraphBuilder builder;

Powered by Google App Engine
This is Rietveld 408576698