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

Unified Diff: ui/compositor/layer.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/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 352a9ce1e1e69e032cc691aa27e34589c2f07689..c635f02d842a95849fa3151dee2b4a635b6ecfec 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -866,7 +866,7 @@ bool Layer::ConvertPointForAncestor(const Layer* ancestor,
gfx::Point* point) const {
gfx::Transform transform;
bool result = GetTargetTransformRelativeTo(ancestor, &transform);
- gfx::Point3F p(*point);
+ auto p = gfx::Point3F(gfx::PointF(*point));
transform.TransformPoint(&p);
*point = gfx::ToFlooredPoint(p.AsPointF());
return result;
@@ -876,7 +876,7 @@ bool Layer::ConvertPointFromAncestor(const Layer* ancestor,
gfx::Point* point) const {
gfx::Transform transform;
bool result = GetTargetTransformRelativeTo(ancestor, &transform);
- gfx::Point3F p(*point);
+ auto p = gfx::Point3F(gfx::PointF(*point));
transform.TransformPointReverse(&p);
*point = gfx::ToFlooredPoint(p.AsPointF());
return result;
@@ -1081,7 +1081,8 @@ void Layer::RecomputeDrawsContentAndUVRect() {
}
void Layer::RecomputePosition() {
- cc_layer_->SetPosition(bounds_.origin() + subpixel_position_offset_);
+ cc_layer_->SetPosition(gfx::PointF(bounds_.origin()) +
+ subpixel_position_offset_);
}
void Layer::AddAnimatorsInTreeToCollection(

Powered by Google App Engine
This is Rietveld 408576698