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

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

Issue 2550083002: Inline LayoutRect::enclosingIntRect (Closed)
Patch Set: Created 4 years 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/LayoutRect.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/LayoutRect.h
diff --git a/third_party/WebKit/Source/platform/geometry/LayoutRect.h b/third_party/WebKit/Source/platform/geometry/LayoutRect.h
index 8a5fe2407420661f01dde76d03e1ba522f1c2e64..545802e42f97a3661c527426173bc31c694ccfb1 100644
--- a/third_party/WebKit/Source/platform/geometry/LayoutRect.h
+++ b/third_party/WebKit/Source/platform/geometry/LayoutRect.h
@@ -278,7 +278,12 @@ inline IntRect pixelSnappedIntRect(const LayoutRect& rect) {
snapSizeToPixel(rect.height(), rect.y())));
}
-PLATFORM_EXPORT IntRect enclosingIntRect(const LayoutRect&);
+inline IntRect enclosingIntRect(const LayoutRect& rect) {
+ IntPoint location = flooredIntPoint(rect.minXMinYCorner());
+ IntPoint maxPoint = ceiledIntPoint(rect.maxXMaxYCorner());
+ return IntRect(location, maxPoint - location);
+}
+
PLATFORM_EXPORT LayoutRect enclosingLayoutRect(const FloatRect&);
inline IntRect pixelSnappedIntRect(LayoutUnit left,
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/geometry/LayoutRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698