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()); |
} |