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

Unified Diff: third_party/WebKit/Source/platform/LayoutUnit.h

Issue 2191233002: Add platform/geometry pretty printers for logging and testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fewer redundant spaces, more toString tests 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/LayoutUnit.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/LayoutUnit.h
diff --git a/third_party/WebKit/Source/platform/LayoutUnit.h b/third_party/WebKit/Source/platform/LayoutUnit.h
index 16677770cb0f7be5762cf5721fd9ef0027c4a294..700aef96bd08df3423fe5895456321b7f03893b8 100644
--- a/third_party/WebKit/Source/platform/LayoutUnit.h
+++ b/third_party/WebKit/Source/platform/LayoutUnit.h
@@ -31,10 +31,12 @@
#ifndef LayoutUnit_h
#define LayoutUnit_h
+#include "platform/PlatformExport.h"
#include "wtf/Allocator.h"
#include "wtf/Assertions.h"
#include "wtf/MathExtras.h"
#include "wtf/SaturatedArithmetic.h"
+#include "wtf/text/WTFString.h"
#include <algorithm>
#include <limits.h>
#include <limits>
@@ -55,7 +57,7 @@ const int intMaxForLayoutUnit = INT_MAX / kFixedPointDenominator;
const int intMinForLayoutUnit = INT_MIN / kFixedPointDenominator;
// TODO(thakis): Remove these two lines once http://llvm.org/PR26504 is resolved
-class LayoutUnit;
+class PLATFORM_EXPORT LayoutUnit;
inline bool operator<(const LayoutUnit&, const LayoutUnit&);
class LayoutUnit {
@@ -212,6 +214,8 @@ public:
return clampTo<LayoutUnit>(value, LayoutUnit::min(), LayoutUnit::max());
}
+ String toString() const;
+
private:
static bool isInBounds(int value)
{
@@ -808,7 +812,7 @@ inline LayoutUnit clampToLayoutUnit(LayoutUnit value, LayoutUnit min, LayoutUnit
inline std::ostream& operator<<(std::ostream& stream, const LayoutUnit& value)
{
- return stream << value.toDouble();
+ return stream << value.toString();
}
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/LayoutUnit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698