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

Unified Diff: Source/core/platform/graphics/FloatPoint.cpp

Issue 18551004: Miscellaneous cleanup to reduce number of includes in platform/graphics/ Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 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 | « Source/core/platform/graphics/FloatPoint.h ('k') | Source/core/platform/graphics/Font.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/graphics/FloatPoint.cpp
diff --git a/Source/core/platform/graphics/FloatPoint.cpp b/Source/core/platform/graphics/FloatPoint.cpp
index 3c1e681fec7be629c8e9807d79b74151b208575f..8a38c898c8dcafae59b21949716e573dae699cf5 100644
--- a/Source/core/platform/graphics/FloatPoint.cpp
+++ b/Source/core/platform/graphics/FloatPoint.cpp
@@ -27,8 +27,6 @@
#include "config.h"
#include "core/platform/graphics/FloatPoint.h"
-#include <math.h>
-#include <limits>
#include "core/platform/FloatConversion.h"
#include "core/platform/graphics/IntPoint.h"
#include "core/platform/graphics/LayoutPoint.h"
@@ -37,6 +35,10 @@
#include "core/platform/graphics/transforms/AffineTransform.h"
#include "core/platform/graphics/transforms/TransformationMatrix.h"
#include "third_party/skia/include/core/SkPoint.h"
+#include "wtf/MathExtras.h"
+
+#include <limits>
+#include <math.h>
namespace WebCore {
@@ -105,6 +107,11 @@ FloatPoint FloatPoint::narrowPrecision(double x, double y)
return FloatPoint(narrowPrecisionToFloat(x), narrowPrecisionToFloat(y));
}
+inline IntPoint roundedIntPoint(const FloatPoint& p)
+{
+ return IntPoint(clampToInteger(roundf(p.x())), clampToInteger(roundf(p.y())));
+}
+
float findSlope(const FloatPoint& p1, const FloatPoint& p2, float& c)
{
if (p2.x() == p1.x())
« no previous file with comments | « Source/core/platform/graphics/FloatPoint.h ('k') | Source/core/platform/graphics/Font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698