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

Unified Diff: third_party/WebKit/Source/platform/testing/PaintPrinters.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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/testing/PaintPrinters.cpp
diff --git a/third_party/WebKit/Source/platform/testing/PaintPrinters.cpp b/third_party/WebKit/Source/platform/testing/PaintPrinters.cpp
index 732da438d5408d7074b3c4d848ee23866a2c638f..7e3d73f42d3e375acc79b281a1499fdbcc7187ec 100644
--- a/third_party/WebKit/Source/platform/testing/PaintPrinters.cpp
+++ b/third_party/WebKit/Source/platform/testing/PaintPrinters.cpp
@@ -26,24 +26,6 @@ class StreamStateSaver : private std::ios {
namespace blink {
-// basic_ostream::operator<<(const void*) is drunk.
-static void PrintPointer(const void* ptr, std::ostream& os) {
- StreamStateSaver saver(os);
- uintptr_t intPtr = reinterpret_cast<uintptr_t>(ptr);
- os << "0x" << std::setfill('0') << std::setw(sizeof(uintptr_t) * 2)
- << std::hex << intPtr;
-}
-
-void PrintTo(const ClipPaintPropertyNode& node, std::ostream* os) {
- *os << "ClipPaintPropertyNode(clip=";
- PrintTo(node.clipRect(), os);
- *os << ", localTransformSpace=";
- PrintPointer(node.localTransformSpace(), *os);
- *os << ", parent=";
- PrintPointer(node.parent(), *os);
- *os << ")";
-}
-
void PrintTo(const PaintChunk& chunk, std::ostream* os) {
*os << "PaintChunk(begin=" << chunk.beginIndex << ", end=" << chunk.endIndex
<< ", id=";
@@ -115,31 +97,20 @@ void PrintTo(const PaintChunkProperties& properties, std::ostream* os) {
*os << ")";
}
-void PrintTo(const TransformPaintPropertyNode& transformPaintProperty,
- std::ostream* os) {
- *os << "TransformPaintPropertyNode(matrix=";
- PrintTo(transformPaintProperty.matrix(), os);
- *os << ", origin=";
- PrintTo(transformPaintProperty.origin(), os);
- *os << ")";
+void PrintTo(const ClipPaintPropertyNode& node, std::ostream* os) {
+ *os << "ClipPaintPropertyNode(" << node.toString().ascii().data() << ")";
+}
+
+void PrintTo(const TransformPaintPropertyNode& node, std::ostream* os) {
+ *os << "TransformPaintPropertyNode(" << node.toString().ascii().data() << ")";
}
-void PrintTo(const EffectPaintPropertyNode& effect, std::ostream* os) {
- *os << "EffectPaintPropertyNode(opacity=" << effect.opacity() << ")";
+void PrintTo(const EffectPaintPropertyNode& node, std::ostream* os) {
+ *os << "EffectPaintPropertyNode(" << node.toString().ascii().data() << ")";
}
void PrintTo(const ScrollPaintPropertyNode& node, std::ostream* os) {
- *os << "ScrollPaintPropertyNode(clip=";
- PrintTo(node.clip(), os);
- *os << ", bounds=";
- PrintTo(node.bounds(), os);
- *os << ", userScrollableHorizontal=" << node.userScrollableHorizontal();
- *os << ", userScrollableVertical=" << node.userScrollableVertical();
- *os << ", scrollOffsetTranslation=";
- PrintPointer(node.scrollOffsetTranslation(), *os);
- *os << ", parent=";
- PrintPointer(node.parent(), *os);
- *os << ")";
+ *os << "ScrollPaintPropertyNode(" << node.toString().ascii().data() << ")";
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/TransformPaintPropertyNode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698