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

Unified Diff: experimental/StrokePathRenderer/GrStrokePathRenderer.cpp

Issue 1135053002: stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix xpsdevice 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 | « bench/GradientBench.cpp ('k') | gm/glyph_pos.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: experimental/StrokePathRenderer/GrStrokePathRenderer.cpp
diff --git a/experimental/StrokePathRenderer/GrStrokePathRenderer.cpp b/experimental/StrokePathRenderer/GrStrokePathRenderer.cpp
index 4b41dba5b16b6afddb15ed363ee6cabf5a6ecd87..e693c41a6690a73959d118db8c8c4d4827c6db35 100644
--- a/experimental/StrokePathRenderer/GrStrokePathRenderer.cpp
+++ b/experimental/StrokePathRenderer/GrStrokePathRenderer.cpp
@@ -39,8 +39,8 @@ static IntersectionType intersection(const SkPoint& p1, const SkPoint& p2,
SkScalar pre = SkScalarMul(x1, y2) - SkScalarMul(y1, x2),
post = SkScalarMul(x3, y4) - SkScalarMul(y3, x4);
// Compute the point of intersection
- res.set(SkScalarDiv(SkScalarMul(pre, x3 - x4) - SkScalarMul(x1 - x2, post), d),
- SkScalarDiv(SkScalarMul(pre, y3 - y4) - SkScalarMul(y1 - y2, post), d));
+ res.set((SkScalarMul(pre, x3 - x4) - SkScalarMul(x1 - x2, post) / d,
+ (SkScalarMul(pre, y3 - y4) - SkScalarMul(y1 - y2, post) / d);
// Check if the x and y coordinates are within both lines
return (res.x() < GrMin(x1, x2) || res.x() > GrMax(x1, x2) ||
@@ -184,9 +184,7 @@ bool GrStrokePathRenderer::onDrawPath(const SkPath& origPath,
SkPoint miterPt1 = miterPt[0] - *pt1;
SkScalar sqDist0 = miterPt0.dot(miterPt0);
SkScalar sqDist1 = miterPt1.dot(miterPt1);
- const SkScalar rSq =
- SkScalarDiv(SkScalarMul(radius, radius),
- sinHalfAngleSq);
+ const SkScalar rSq = radius*radius / sinHalfAngleSq;
const SkScalar sqRLimit =
SkScalarMul(sqMiterLimit, rSq);
if (sqDist0 > sqRLimit || sqDist1 > sqRLimit) {
« no previous file with comments | « bench/GradientBench.cpp ('k') | gm/glyph_pos.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698