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

Unified Diff: third_party/WebKit/Source/platform/geometry/FloatRect.h

Issue 2628903003: Inline FloatRect::enclosingIntRect (Closed)
Patch Set: Created 3 years, 11 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/geometry/FloatRect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/geometry/FloatRect.h
diff --git a/third_party/WebKit/Source/platform/geometry/FloatRect.h b/third_party/WebKit/Source/platform/geometry/FloatRect.h
index d95058648ec65d9cf0ba2e108b094947c8fd7d9a..00de1b831dfaf6a756e3d856e3f561079e676312 100644
--- a/third_party/WebKit/Source/platform/geometry/FloatRect.h
+++ b/third_party/WebKit/Source/platform/geometry/FloatRect.h
@@ -29,6 +29,7 @@
#include "platform/geometry/FloatPoint.h"
#include "platform/geometry/FloatRectOutsets.h"
+#include "platform/geometry/IntRect.h"
#include "third_party/skia/include/core/SkRect.h"
#include "wtf/Allocator.h"
#include "wtf/Forward.h"
@@ -49,7 +50,6 @@ class RectF;
namespace blink {
-class IntRect;
class LayoutRect;
class LayoutSize;
@@ -256,7 +256,12 @@ inline bool operator!=(const FloatRect& a, const FloatRect& b) {
return a.location() != b.location() || a.size() != b.size();
}
-PLATFORM_EXPORT IntRect enclosingIntRect(const FloatRect&);
+inline IntRect enclosingIntRect(const FloatRect& rect) {
+ IntPoint location = flooredIntPoint(rect.minXMinYCorner());
+ IntPoint maxPoint = ceiledIntPoint(rect.maxXMaxYCorner());
+
+ return IntRect(location, maxPoint - location);
+}
// Returns a valid IntRect contained within the given FloatRect.
PLATFORM_EXPORT IntRect enclosedIntRect(const FloatRect&);
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/geometry/FloatRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698