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

Unified Diff: Source/WebCore/platform/graphics/FloatRect.cpp

Issue 7155005: Merge 87103 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 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/JavaScriptCore/wtf/MathExtras.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/FloatRect.cpp
===================================================================
--- Source/WebCore/platform/graphics/FloatRect.cpp (revision 88844)
+++ Source/WebCore/platform/graphics/FloatRect.cpp (working copy)
@@ -182,18 +182,6 @@
setLocationAndSizeFromEdges(left, top, right, bottom);
}
-static inline int safeFloatToInt(float x)
-{
- static const int s_intMax = std::numeric_limits<int>::max();
- static const int s_intMin = std::numeric_limits<int>::min();
-
- if (x >= static_cast<float>(s_intMax))
- return s_intMax;
- if (x < static_cast<float>(s_intMin))
- return s_intMin;
- return static_cast<int>(x);
-}
-
IntRect enclosingIntRect(const FloatRect& rect)
{
float left = floorf(rect.x());
@@ -201,8 +189,8 @@
float width = ceilf(rect.maxX()) - left;
float height = ceilf(rect.maxY()) - top;
- return IntRect(safeFloatToInt(left), safeFloatToInt(top),
- safeFloatToInt(width), safeFloatToInt(height));
+ return IntRect(clampToInteger(left), clampToInteger(top),
+ clampToInteger(width), clampToInteger(height));
}
FloatRect mapRect(const FloatRect& r, const FloatRect& srcRect, const FloatRect& destRect)
« no previous file with comments | « Source/JavaScriptCore/wtf/MathExtras.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698