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

Unified Diff: ui/gfx/geometry/rect_f.cc

Issue 1271123002: Mac: Enable partial swap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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 | « ui/gfx/geometry/rect_f.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/rect_f.cc
diff --git a/ui/gfx/geometry/rect_f.cc b/ui/gfx/geometry/rect_f.cc
index c87ea3de6ac05f9fb700a92a3ff28b874244f3b4..a15bdf36a7808aedf5f5fa5924bfacc962522db4 100644
--- a/ui/gfx/geometry/rect_f.cc
+++ b/ui/gfx/geometry/rect_f.cc
@@ -6,6 +6,12 @@
#include <algorithm>
+#if defined(OS_IOS)
+#include <CoreGraphics/CoreGraphics.h>
+#elif defined(OS_MACOSX)
+#include <ApplicationServices/ApplicationServices.h>
+#endif
+
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "ui/gfx/geometry/insets_f.h"
@@ -24,6 +30,16 @@ static void AdjustAlongAxis(float dst_origin,
*origin = std::min(dst_origin + dst_size, *origin + *size) - *size;
}
+#if defined(OS_MACOSX)
+RectF::RectF(const CGRect& r)
+ : origin_(r.origin.x, r.origin.y), size_(r.size.width, r.size.height) {
+}
+
+CGRect RectF::ToCGRect() const {
+ return CGRectMake(x(), y(), width(), height());
+}
+#endif
+
void RectF::Inset(const InsetsF& insets) {
Inset(insets.left(), insets.top(), insets.right(), insets.bottom());
}
« no previous file with comments | « ui/gfx/geometry/rect_f.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698