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

Unified Diff: ui/gfx/transform_util.cc

Issue 1372253002: gfx: Make conversions from gfx::Point to PointF explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-gfx: . Created 5 years, 3 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
Index: ui/gfx/transform_util.cc
diff --git a/ui/gfx/transform_util.cc b/ui/gfx/transform_util.cc
index 33c550837acb788c5c94ed6933866e55ea45f486..330ac191da6ff595c06f82b7c0f77b4df9274f0d 100644
--- a/ui/gfx/transform_util.cc
+++ b/ui/gfx/transform_util.cc
@@ -231,7 +231,7 @@ Transform ComposeTransform(const SkMatrix44& perspective,
return to_return;
}
-bool CheckViewportPointMapsWithinOnePixel(const Point& point,
+bool CheckViewportPointMapsWithinOnePixel(const PointF& point,
const Transform& transform) {
Point3F point_original(point);
Point3F point_transformed(point);
@@ -259,12 +259,14 @@ bool CheckTransformsMapsIntViewportWithinOnePixel(const Rect& viewport,
Transform combined = snapped * original_inv;
- return CheckViewportPointMapsWithinOnePixel(viewport.origin(), combined) &&
- CheckViewportPointMapsWithinOnePixel(viewport.top_right(), combined) &&
- CheckViewportPointMapsWithinOnePixel(viewport.bottom_left(),
+ return CheckViewportPointMapsWithinOnePixel(gfx::PointF(viewport.origin()),
combined) &&
- CheckViewportPointMapsWithinOnePixel(viewport.bottom_right(),
- combined);
+ CheckViewportPointMapsWithinOnePixel(gfx::PointF(viewport.top_right()),
+ combined) &&
+ CheckViewportPointMapsWithinOnePixel(
+ gfx::PointF(viewport.bottom_left()), combined) &&
+ CheckViewportPointMapsWithinOnePixel(
+ gfx::PointF(viewport.bottom_right()), combined);
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698