| Index: ui/gfx/geometry/point.cc
|
| diff --git a/ui/gfx/geometry/point.cc b/ui/gfx/geometry/point.cc
|
| index cf8919e2573332295b35e211f83ea35ad78a6e67..0f18afd0bc1e73a14cf01e30e8dfa78abdc58574 100644
|
| --- a/ui/gfx/geometry/point.cc
|
| +++ b/ui/gfx/geometry/point.cc
|
| @@ -13,6 +13,8 @@
|
| #endif
|
|
|
| #include "base/strings/stringprintf.h"
|
| +#include "ui/gfx/geometry/point_conversions.h"
|
| +#include "ui/gfx/geometry/point_f.h"
|
|
|
| namespace gfx {
|
|
|
| @@ -63,4 +65,40 @@ std::string Point::ToString() const {
|
| return base::StringPrintf("%d,%d", x(), y());
|
| }
|
|
|
| +Point ScaleToCeiledPoint(const Point& point, float x_scale, float y_scale) {
|
| + if (x_scale == 1.f && y_scale == 1.f)
|
| + return point;
|
| + return ToCeiledPoint(ScalePoint(gfx::PointF(point), x_scale, y_scale));
|
| +}
|
| +
|
| +Point ScaleToCeiledPoint(const Point& point, float scale) {
|
| + if (scale == 1.f)
|
| + return point;
|
| + return ToCeiledPoint(ScalePoint(gfx::PointF(point), scale, scale));
|
| +}
|
| +
|
| +Point ScaleToFlooredPoint(const Point& point, float x_scale, float y_scale) {
|
| + if (x_scale == 1.f && y_scale == 1.f)
|
| + return point;
|
| + return ToFlooredPoint(ScalePoint(gfx::PointF(point), x_scale, y_scale));
|
| +}
|
| +
|
| +Point ScaleToFlooredPoint(const Point& point, float scale) {
|
| + if (scale == 1.f)
|
| + return point;
|
| + return ToFlooredPoint(ScalePoint(gfx::PointF(point), scale, scale));
|
| +}
|
| +
|
| +Point ScaleToRoundedPoint(const Point& point, float x_scale, float y_scale) {
|
| + if (x_scale == 1.f && y_scale == 1.f)
|
| + return point;
|
| + return ToRoundedPoint(ScalePoint(gfx::PointF(point), x_scale, y_scale));
|
| +}
|
| +
|
| +Point ScaleToRoundedPoint(const Point& point, float scale) {
|
| + if (scale == 1.f)
|
| + return point;
|
| + return ToRoundedPoint(ScalePoint(gfx::PointF(point), scale, scale));
|
| +}
|
| +
|
| } // namespace gfx
|
|
|