Index: ui/gfx/rect.cc |
diff --git a/ui/gfx/rect.cc b/ui/gfx/rect.cc |
index 8fc2cfbe2785cdf0f4557b920debc4a90f88a28f..bb2723b2136a51902155124847cd3e43a2dacc81 100644 |
--- a/ui/gfx/rect.cc |
+++ b/ui/gfx/rect.cc |
@@ -14,6 +14,7 @@ |
#include "base/stringprintf.h" |
#include "ui/gfx/insets.h" |
#include "ui/gfx/rect_base_impl.h" |
+#include "ui/gfx/rect_conversions.h" |
namespace gfx { |
@@ -106,6 +107,18 @@ GdkRectangle Rect::ToGdkRectangle() const { |
} |
#endif |
+Rect ToRect(const RectF& rect) { |
+ return Rect(rect.origin().ToPoint(), rect.size().ToSize()); |
+} |
+ |
+Rect Rect::ScaleUnsafe(float scale) const { |
+ return ToRect(Scale(scale)); |
+} |
+ |
+Rect Rect::ScaleUnsafe(float x_scale, float y_scale) const { |
+ return ToRect(Scale(x_scale, y_scale)); |
+} |
+ |
std::string Rect::ToString() const { |
return base::StringPrintf("%s %s", |
origin().ToString().c_str(), |