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

Unified Diff: src/gpu/GrOvalRenderer.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/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrPathUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOvalRenderer.cpp
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index b5621674248cdc548ee19aa2a9afadd29d97d04c..ebac42fcac8744c36f88d14ea5c05daf662bf68a 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -1253,11 +1253,11 @@
const SkRect& bounds = geom.fBounds;
// This adjusts the "radius" to include the half-pixel border
- SkScalar offsetDx = geom.fGeoDx / xRadius;
- SkScalar offsetDy = geom.fGeoDy / yRadius;
-
- SkScalar innerRatioX = xRadius / geom.fInnerXRadius;
- SkScalar innerRatioY = yRadius / geom.fInnerYRadius;
+ SkScalar offsetDx = SkScalarDiv(geom.fGeoDx, xRadius);
+ SkScalar offsetDy = SkScalarDiv(geom.fGeoDy, yRadius);
+
+ SkScalar innerRatioX = SkScalarDiv(xRadius, geom.fInnerXRadius);
+ SkScalar innerRatioY = SkScalarDiv(yRadius, geom.fInnerYRadius);
verts[0].fPos = SkPoint::Make(bounds.fLeft, bounds.fTop);
verts[0].fOuterOffset = SkPoint::Make(-1.0f - offsetDx, -1.0f - offsetDy);
@@ -1386,8 +1386,8 @@
SkScalar b = viewMatrix[SkMatrix::kMSkewX];
SkScalar c = viewMatrix[SkMatrix::kMSkewY];
SkScalar d = viewMatrix[SkMatrix::kMScaleY];
- SkScalar geoDx = SK_ScalarHalf / SkScalarSqrt(a*a + c*c);
- SkScalar geoDy = SK_ScalarHalf / SkScalarSqrt(b*b + d*d);
+ SkScalar geoDx = SkScalarDiv(SK_ScalarHalf, SkScalarSqrt(a*a + c*c));
+ SkScalar geoDy = SkScalarDiv(SK_ScalarHalf, SkScalarSqrt(b*b + d*d));
DIEllipseBatch::Geometry geometry;
geometry.fViewMatrix = viewMatrix;
« no previous file with comments | « src/gpu/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrPathUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698