summaryrefslogtreecommitdiffstats
path: root/cc/base/math_util.cc
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-25 03:25:05 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-25 03:25:05 +0000
commit6138db702aa3c08703b2952b5aaa1ba7533a3813 (patch)
tree003d2b10f8a20ef82911b63d060084997ef958a7 /cc/base/math_util.cc
parent63f8b5a1835d589ba335006749b04d1aa2340bd7 (diff)
downloadchromium_src-6138db702aa3c08703b2952b5aaa1ba7533a3813.zip
chromium_src-6138db702aa3c08703b2952b5aaa1ba7533a3813.tar.gz
chromium_src-6138db702aa3c08703b2952b5aaa1ba7533a3813.tar.bz2
Fix compilation and ui_unittests with float transforms
This change also cleans up the use of gfx::Transform::get/setDouble (in favor of get/set) at callsites to prepare for changing SkMScalar from double to float. BUG=269817 Originally Committed/Reverted: https://src.chromium.org/viewvc/chrome?view=rev&revision=224725 Review URL: https://chromiumcodereview.appspot.com/23811009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225130 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/base/math_util.cc')
-rw-r--r--cc/base/math_util.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/cc/base/math_util.cc b/cc/base/math_util.cc
index 40b8d11..764c461 100644
--- a/cc/base/math_util.cc
+++ b/cc/base/math_util.cc
@@ -72,13 +72,13 @@ static HomogeneousCoordinate ComputeClippedPointForEdge(
// w plane when this is called.
DCHECK(h1.ShouldBeClipped() ^ h2.ShouldBeClipped());
- SkMScalar w = 0.00001; // or any positive non-zero small epsilon
+ // ...or any positive non-zero small epsilon
+ double w = 0.00001;
+ double t = (w - h1.w()) / (h2.w() - h1.w());
- SkMScalar t = (w - h1.w()) / (h2.w() - h1.w());
-
- SkMScalar x = (1 - t) * h1.x() + t * h2.x();
- SkMScalar y = (1 - t) * h1.y() + t * h2.y();
- SkMScalar z = (1 - t) * h1.z() + t * h2.z();
+ SkMScalar x = SkDoubleToMScalar((1.0 - t) * h1.x() + t * h2.x());
+ SkMScalar y = SkDoubleToMScalar((1.0 - t) * h1.y() + t * h2.y());
+ SkMScalar z = SkDoubleToMScalar((1.0 - t) * h1.z() + t * h2.z());
return HomogeneousCoordinate(x, y, z, w);
}