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

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

Issue 2299533002: WIP: Construct SPV2's scroll paint property tree (Closed)
Patch Set: Add more paint property builder tests, update comments/documentation" 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 ecfa21d905a89406622d2507c7e5bfa4d29594ba..31f93622ee54c917f694a44c104e1f57846266f8 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinter.cpp
@@ -192,6 +192,39 @@ public:
}
};
+template <>
+class PropertyTreePrinterTraits<ScrollPaintPropertyNode> {
+public:
+ static void addFrameViewProperties(const FrameView& frameView, PropertyTreePrinter<ScrollPaintPropertyNode>& printer)
+ {
+ if (const ScrollPaintPropertyNode* rootScroll = frameView.rootScroll())
+ printer.addPropertyNode(rootScroll, "RootScroll (FrameView)");
+ if (const ScrollPaintPropertyNode* scroll = frameView.scroll())
+ printer.addPropertyNode(scroll, "Scroll (FrameView)");
+ }
+
+ static void addObjectPaintProperties(const LayoutObject& object, const ObjectPaintProperties& paintProperties, PropertyTreePrinter<ScrollPaintPropertyNode>& printer)
+ {
+ if (const ScrollPaintPropertyNode* scroll = paintProperties.scroll())
+ printer.addPropertyNode(scroll, "Scroll (" + object.debugName() + ")");
+ }
+
+ static void printNodeAsString(const ScrollPaintPropertyNode* node, StringBuilder& stringBuilder)
+ {
+ FloatSize scrollOffset = node->scrollOffsetTranslation()->matrix().to2DTranslation();
+ stringBuilder.append(" scrollOffsetTranslation=");
+ stringBuilder.append(scrollOffset.toString());
+ stringBuilder.append(" clip=");
+ stringBuilder.append(node->clip().toString());
+ stringBuilder.append(" bounds=");
+ stringBuilder.append(node->bounds().toString());
+ stringBuilder.append(" userScrollableHorizontal=");
+ stringBuilder.append(node->userScrollableHorizontal() ? "yes" : "no");
+ stringBuilder.append(" userScrollableVertical=");
+ stringBuilder.append(node->userScrollableVertical() ? "yes" : "no");
+ }
+};
+
class PaintPropertyTreeGraphBuilder {
public:
PaintPropertyTreeGraphBuilder() { }
@@ -318,6 +351,11 @@ private:
writeParentEdge(&node, node.parent(), s_effectNodeColor, os);
}
+ void writePaintPropertyNode(const ScrollPaintPropertyNode&, const void*, const char*)
+ {
+ // TODO(pdr): fill this out.
+ }
+
void writeObjectPaintPropertyNodes(const LayoutObject& object)
{
const ObjectPaintProperties* properties = object.objectPaintProperties();
@@ -356,6 +394,9 @@ private:
if (object.isLayoutView() && overflowClip->parent())
writePaintPropertyNode(*overflowClip->parent(), nullptr, "rootClip");
}
+ const ScrollPaintPropertyNode* scroll = properties->scroll();
+ if (scroll)
+ writePaintPropertyNode(*scroll, &object, "scroll");
}
void writeFrameViewPaintPropertyNodes(const FrameView& frameView)
@@ -378,6 +419,9 @@ private:
ClipPaintPropertyNode* contentClip = frameView.contentClip();
if (contentClip)
writePaintPropertyNode(*contentClip, &frameView, "contentClip");
+ ScrollPaintPropertyNode* scroll = frameView.scroll();
+ if (scroll)
+ writePaintPropertyNode(*scroll, &frameView, "scroll");
}
void writeLayoutObjectNode(const LayoutObject& object)
@@ -456,6 +500,11 @@ void showEffectPropertyTree(const blink::FrameView& rootFrame)
blink::PropertyTreePrinter<blink::EffectPaintPropertyNode>().showTree(rootFrame);
}
+void showScrollPropertyTree(const blink::FrameView& rootFrame)
+{
+ blink::PropertyTreePrinter<blink::ScrollPaintPropertyNode>().showTree(rootFrame);
+}
+
void showPaintPropertyPath(const blink::TransformPaintPropertyNode* node)
{
blink::PropertyTreePrinter<blink::TransformPaintPropertyNode>().showPath(node);
@@ -471,6 +520,11 @@ void showPaintPropertyPath(const blink::EffectPaintPropertyNode* node)
blink::PropertyTreePrinter<blink::EffectPaintPropertyNode>().showPath(node);
}
+void showPaintPropertyPath(const blink::ScrollPaintPropertyNode* node)
+{
+ blink::PropertyTreePrinter<blink::ScrollPaintPropertyNode>().showPath(node);
+}
+
String paintPropertyTreeGraph(const blink::FrameView& frameView)
{
blink::PaintPropertyTreeGraphBuilder builder;

Powered by Google App Engine
This is Rietveld 408576698