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

Unified Diff: ui/views/view.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/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 7e0440ea729e188ef97ac865d10b6368ce08dfa5..94a0afbbb142325441e9d3606ef9cfbf37413189 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -1982,7 +1982,7 @@ bool View::ConvertPointForAncestor(const View* ancestor,
gfx::Transform trans;
// TODO(sad): Have some way of caching the transformation results.
bool result = GetTransformRelativeTo(ancestor, &trans);
- gfx::Point3F p(*point);
+ auto p = gfx::Point3F(gfx::PointF(*point));
trans.TransformPoint(&p);
*point = gfx::ToFlooredPoint(p.AsPointF());
return result;
@@ -1992,7 +1992,7 @@ bool View::ConvertPointFromAncestor(const View* ancestor,
gfx::Point* point) const {
gfx::Transform trans;
bool result = GetTransformRelativeTo(ancestor, &trans);
- gfx::Point3F p(*point);
+ auto p = gfx::Point3F(gfx::PointF(*point));
trans.TransformPointReverse(&p);
*point = gfx::ToFlooredPoint(p.AsPointF());
return result;

Powered by Google App Engine
This is Rietveld 408576698