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

Unified Diff: Source/platform/geometry/FloatPoint.cpp

Issue 25494003: Move geometry classes from core/platform/graphics to platform/geometry (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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/platform/geometry/FloatPoint.h ('k') | Source/platform/geometry/FloatPoint3D.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/geometry/FloatPoint.cpp
diff --git a/Source/core/platform/graphics/FloatPoint.cpp b/Source/platform/geometry/FloatPoint.cpp
similarity index 88%
rename from Source/core/platform/graphics/FloatPoint.cpp
rename to Source/platform/geometry/FloatPoint.cpp
index d92d6abfdd05244e255b358fee57dfa954cda559..121d16e6959bf4ec4a0e4f9ed9c66075ff727686 100644
--- a/Source/core/platform/graphics/FloatPoint.cpp
+++ b/Source/platform/geometry/FloatPoint.cpp
@@ -25,21 +25,26 @@
*/
#include "config.h"
-#include "core/platform/graphics/FloatPoint.h"
-
-#include <math.h>
+#include "platform/geometry/FloatPoint.h"
+
+#include "SkPoint.h"
+#include "platform/FloatConversion.h"
+#include "platform/geometry/IntPoint.h"
+#include "platform/geometry/LayoutPoint.h"
+#include "platform/geometry/LayoutSize.h"
+#include "platform/transforms/AffineTransform.h"
+#include "platform/transforms/TransformationMatrix.h"
#include <limits>
-#include "core/platform/FloatConversion.h"
-#include "core/platform/graphics/IntPoint.h"
-#include "core/platform/graphics/LayoutPoint.h"
-#include "core/platform/graphics/LayoutSize.h"
-#include "core/platform/graphics/skia/SkiaUtils.h"
-#include "core/platform/graphics/transforms/AffineTransform.h"
-#include "core/platform/graphics/transforms/TransformationMatrix.h"
-#include "third_party/skia/include/core/SkPoint.h"
+#include <math.h>
namespace WebCore {
+// Skia has problems when passed infinite, etc floats, filter them to 0.
+static inline SkScalar WebCoreFloatToSkScalar(float f)
+{
+ return SkFloatToScalar(std::isfinite(f) ? f : 0);
+}
+
FloatPoint::FloatPoint(const IntPoint& p) : m_x(p.x()), m_y(p.y())
{
}
« no previous file with comments | « Source/platform/geometry/FloatPoint.h ('k') | Source/platform/geometry/FloatPoint3D.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698