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

Unified Diff: third_party/WebKit/Source/platform/geometry/LayoutRect.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: Fastest logging this side of the mississippi Created 4 years, 4 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/LayoutRect.cpp
diff --git a/third_party/WebKit/Source/platform/geometry/LayoutRect.cpp b/third_party/WebKit/Source/platform/geometry/LayoutRect.cpp
index 7e7b2ddaefc79d83e025f933187d05644953f871..68e27c56387a3d4dd48a593b39e8b4adaee2f9f9 100644
--- a/third_party/WebKit/Source/platform/geometry/LayoutRect.cpp
+++ b/third_party/WebKit/Source/platform/geometry/LayoutRect.cpp
@@ -142,21 +142,6 @@ void LayoutRect::scale(float xAxisScale, float yAxisScale)
m_size.scale(xAxisScale, yAxisScale);
}
-#ifndef NDEBUG
-void LayoutRect::show(bool showRawValue) const
-{
- if (showRawValue)
- printf("Rect (in raw layout units): [x=%d y=%d maxX=%d maxY=%d]\n", x().rawValue(), y().rawValue(), maxX().rawValue(), maxY().rawValue());
wkorman 2016/08/19 22:18:44 Are layout folks ok with losing the raw value view
pdr. 2016/08/19 23:21:15 This is a good point, but I think we're covered wi
- else
- printf("Rect (in pixels): [x=%lf y=%lf maxX=%lf maxY=%lf]\n", x().toDouble(), y().toDouble(), maxX().toDouble(), maxY().toDouble());
-}
-
-String LayoutRect::toString() const
-{
- return String::format("%s %s", location().toString().ascii().data(), size().toString().ascii().data());
-}
-#endif
-
LayoutRect unionRect(const Vector<LayoutRect>& rects)
{
LayoutRect result;
@@ -196,4 +181,11 @@ LayoutRect enclosingLayoutRect(const FloatRect& rect)
return LayoutRect(location, maxPoint - location);
}
+String LayoutRect::toString() const
+{
+ return String::format("%s %s",
+ location().toString().ascii().data(),
+ size().toString().ascii().data());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698