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

Unified Diff: ui/gfx/interpolated_transform.cc

Issue 649203003: Type conversion fixes, ui/gfx/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 6 years, 2 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/interpolated_transform.cc
diff --git a/ui/gfx/interpolated_transform.cc b/ui/gfx/interpolated_transform.cc
index 693b6567f7f53f01b266818001cf7d188f011f86..187ad8419378c5509aee901979399df60f82b334 100644
--- a/ui/gfx/interpolated_transform.cc
+++ b/ui/gfx/interpolated_transform.cc
@@ -274,9 +274,12 @@ InterpolatedTranslation::~InterpolatedTranslation() {}
gfx::Transform
InterpolatedTranslation::InterpolateButDoNotCompose(float t) const {
gfx::Transform result;
- result.Translate3d(ValueBetween(t, start_pos_.x(), end_pos_.x()),
- ValueBetween(t, start_pos_.y(), end_pos_.y()),
- ValueBetween(t, start_pos_.z(), end_pos_.z()));
+ result.Translate3d(ValueBetween(t, static_cast<float>(start_pos_.x()),
danakj 2014/10/18 18:40:06 isn't start_pos_ floats already? https://code.goog
Peter Kasting 2014/10/20 23:38:56 Yes -- I think this got changed since the time I o
+ static_cast<float>(end_pos_.x())),
+ ValueBetween(t, static_cast<float>(start_pos_.y()),
+ static_cast<float>(end_pos_.y())),
+ ValueBetween(t, static_cast<float>(start_pos_.z()),
+ static_cast<float>(end_pos_.z())));
return result;
}
@@ -331,8 +334,10 @@ void InterpolatedTransformAboutPivot::Init(const gfx::Point& pivot,
InterpolatedTransform* xform) {
gfx::Transform to_pivot;
gfx::Transform from_pivot;
- to_pivot.Translate(-pivot.x(), -pivot.y());
- from_pivot.Translate(pivot.x(), pivot.y());
+ to_pivot.Translate(SkScalarToMScalar(SkIntToScalar(-pivot.x())),
danakj 2014/10/18 18:40:06 yo dawg, i heard you like static casts :/ we shou
Peter Kasting 2014/10/20 23:38:56 Filed https://code.google.com/p/skia/issues/detail
+ SkScalarToMScalar(SkIntToScalar(-pivot.y())));
+ from_pivot.Translate(SkScalarToMScalar(SkIntToScalar(pivot.x())),
+ SkScalarToMScalar(SkIntToScalar(pivot.y())));
scoped_ptr<InterpolatedTransform> pre_transform(
new InterpolatedConstantTransform(to_pivot));

Powered by Google App Engine
This is Rietveld 408576698