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

Unified Diff: src/gpu/GrPathUtils.cpp

Issue 1138263002: Revert of stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPathUtils.cpp
diff --git a/src/gpu/GrPathUtils.cpp b/src/gpu/GrPathUtils.cpp
index 3e2c3bfe6691655ebf4f6b56dea15d9c8e02af4b..2a906664f26c40d92784e2fd8a439c6bdadc9eca 100644
--- a/src/gpu/GrPathUtils.cpp
+++ b/src/gpu/GrPathUtils.cpp
@@ -29,7 +29,8 @@
stretch = SkMaxScalar(stretch, mat.mapRadius(SK_Scalar1));
}
}
- return srcTol / stretch;
+ srcTol = SkScalarDiv(srcTol, stretch);
+ return srcTol;
}
static const int MAX_POINTS_PER_CURVE = 1 << 10;
@@ -50,7 +51,7 @@
// subdivide x = log4(d/tol) times. x subdivisions creates 2^(x)
// points.
// 2^(log4(x)) = sqrt(x);
- SkScalar divSqrt = SkScalarSqrt(d / tol);
+ SkScalar divSqrt = SkScalarSqrt(SkScalarDiv(d, tol));
if (((SkScalar)SK_MaxS32) <= divSqrt) {
return MAX_POINTS_PER_CURVE;
} else {
@@ -106,11 +107,11 @@
if (d <= tol) {
return 1;
} else {
- SkScalar divSqrt = SkScalarSqrt(d / tol);
+ SkScalar divSqrt = SkScalarSqrt(SkScalarDiv(d, tol));
if (((SkScalar)SK_MaxS32) <= divSqrt) {
return MAX_POINTS_PER_CURVE;
} else {
- int temp = SkScalarCeilToInt(SkScalarSqrt(d / tol));
+ int temp = SkScalarCeilToInt(SkScalarSqrt(SkScalarDiv(d, tol)));
int pow2 = GrNextPow2(temp);
// Because of NaNs & INFs we can wind up with a degenerate temp
// such that pow2 comes out negative. Also, our point generator
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698