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

Unified Diff: third_party/WebKit/Source/platform/geometry/IntRect.cpp

Issue 2191233002: Add platform/geometry pretty printers for logging and testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust tests to work around uninteresting cross-platform differences Created 4 years, 5 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/platform/geometry/IntRect.cpp
diff --git a/third_party/WebKit/Source/platform/geometry/IntRect.cpp b/third_party/WebKit/Source/platform/geometry/IntRect.cpp
index 0539c8e88aae271dc0373421969fb45d2cc611a1..6fa23bb2d286ec9846b4766086d9c4cc80b45dae 100644
--- a/third_party/WebKit/Source/platform/geometry/IntRect.cpp
+++ b/third_party/WebKit/Source/platform/geometry/IntRect.cpp
@@ -29,9 +29,9 @@
#include "platform/geometry/LayoutRect.h"
#include "third_party/skia/include/core/SkRect.h"
#include "ui/gfx/geometry/rect.h"
-#include "wtf/text/WTFString.h"
#include <algorithm>
+#include <ostream> // NOLINT
namespace blink {
@@ -187,17 +187,14 @@ IntRect unionRectEvenIfEmpty(const Vector<IntRect>& rects)
return result;
}
-#ifndef NDEBUG
- // Prints the rect to the screen.
-void IntRect::show() const
+std::ostream& operator<<(std::ostream& os, const IntRect& rect)
{
- LayoutRect(*this).show();
+ os << "IntRect("
+ << "x=" << rect.x() << ", "
+ << "y=" << rect.y() << ", "
+ << "width=" << rect.width() << ", "
+ << "height=" << rect.height() << ")";
+ return os;
}
-String IntRect::toString() const
-{
- return String::format("%s %s", location().toString().ascii().data(), size().toString().ascii().data());
-}
-#endif
-
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698