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

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

Issue 2574713003: Add toString() for paint property node classes (Closed)
Patch Set: Update test 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/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 c0b17fd691635b6bdc8549cbc026ecd3f52e65a0..328c5d18c58a888a5e4189cf98978027e67954be 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinter.cpp
@@ -90,8 +90,8 @@ class PropertyTreePrinter {
stringBuilder.append(' ');
if (m_nodeToDebugString.contains(node))
stringBuilder.append(m_nodeToDebugString.get(node));
- stringBuilder.append(String::format(" %p", node));
- Traits::printNodeAsString(node, stringBuilder);
+ stringBuilder.append(String::format(" %p ", node));
+ stringBuilder.append(node->toString());
stringBuilder.append("\n");
for (const auto* childNode : m_nodeToDebugString.keys()) {
@@ -162,38 +162,6 @@ class PropertyTreePrinterTraits<TransformPaintPropertyNode> {
scrollbarPaintOffset,
"ScrollbarPaintOffset (" + object.debugName() + ")");
}
-
- static void printNodeAsString(const TransformPaintPropertyNode* node,
- StringBuilder& stringBuilder) {
- stringBuilder.append(" transform=");
-
- TransformationMatrix::DecomposedType decomposition;
- if (!node->matrix().decompose(decomposition)) {
- stringBuilder.append("degenerate");
- return;
- }
-
- stringBuilder.append(
- String::format("translation=%f,%f,%f", decomposition.translateX,
- decomposition.translateY, decomposition.translateZ));
- if (node->matrix().isIdentityOrTranslation())
- return;
-
- stringBuilder.append(
- String::format(", scale=%f,%f,%f", decomposition.scaleX,
- decomposition.scaleY, decomposition.scaleZ));
- stringBuilder.append(String::format(", skew=%f,%f,%f", decomposition.skewXY,
- decomposition.skewXZ,
- decomposition.skewYZ));
- stringBuilder.append(
- String::format(", quaternion=%f,%f,%f,%f", decomposition.quaternionX,
- decomposition.quaternionY, decomposition.quaternionZ,
- decomposition.quaternionW));
- stringBuilder.append(
- String::format(", perspective=%f,%f,%f,%f", decomposition.perspectiveX,
- decomposition.perspectiveY, decomposition.perspectiveZ,
- decomposition.perspectiveW));
- }
};
template <>
@@ -227,16 +195,6 @@ class PropertyTreePrinterTraits<ClipPaintPropertyNode> {
printer.addPropertyNode(overflowClip,
"OverflowClip (" + object.debugName() + ")");
}
-
- static void printNodeAsString(const ClipPaintPropertyNode* node,
- StringBuilder& stringBuilder) {
- stringBuilder.append(String::format(" localTransformSpace=%p ",
- node->localTransformSpace()));
- stringBuilder.append(String::format(
- "rect=%f,%f,%f,%f", node->clipRect().rect().x(),
- node->clipRect().rect().y(), node->clipRect().rect().width(),
- node->clipRect().rect().height()));
- }
};
template <>
@@ -253,11 +211,6 @@ class PropertyTreePrinterTraits<EffectPaintPropertyNode> {
if (const EffectPaintPropertyNode* effect = paintProperties.effect())
printer.addPropertyNode(effect, "Effect (" + object.debugName() + ")");
}
-
- static void printNodeAsString(const EffectPaintPropertyNode* node,
- StringBuilder& stringBuilder) {
- stringBuilder.append(String::format(" opacity=%f", node->opacity()));
- }
};
template <>
@@ -277,27 +230,6 @@ class PropertyTreePrinterTraits<ScrollPaintPropertyNode> {
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");
- stringBuilder.append(" threadedScrollingDisabled=");
- stringBuilder.append(node->threadedScrollingDisabled() ? "yes" : "no");
- stringBuilder.append(" hasBackgroundAttachmentFixedDescendants=");
- stringBuilder.append(
- node->hasBackgroundAttachmentFixedDescendants() ? "yes" : "no");
- }
};
class PaintPropertyTreeGraphBuilder {
« no previous file with comments | « cc/output/filter_operations_unittest.cc ('k') | third_party/WebKit/Source/platform/graphics/CompositorFilterOperations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698