diff options
author | caryclark <caryclark@google.com> | 2015-05-29 08:11:16 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-29 08:11:16 -0700 |
commit | ecaf9c9c21a4f359f060cb4f7cc98dfc7caacb91 (patch) | |
tree | 5554228e098bc1bee2b1ad462ce7c2638fb994fb | |
parent | 29f8679068ecbd693e123a59b09a5ade3cfde996 (diff) |
use inline version of eval quad if tangent is not needed
R=reed@google.com
Review URL: https://codereview.chromium.org/1160163002
-rw-r--r-- | src/core/SkStroke.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/SkStroke.cpp b/src/core/SkStroke.cpp index 589c98879b..a05bfd448f 100644 --- a/src/core/SkStroke.cpp +++ b/src/core/SkStroke.cpp @@ -599,7 +599,7 @@ SkPathStroker::ReductionType SkPathStroker::CheckQuadLinear(const SkPoint quad[3 if (0 == t) { return kLine_ReductionType; } - SkEvalQuadAt(quad, t, reduction, NULL); + *reduction = SkEvalQuadAt(quad, t); return kDegenerate_ReductionType; } @@ -905,8 +905,7 @@ static bool sharp_angle(const SkPoint quad[3]) { SkPathStroker::ResultType SkPathStroker::strokeCloseEnough(const SkPoint stroke[3], const SkPoint ray[2], SkQuadConstruct* quadPts STROKER_DEBUG_PARAMS(int depth)) const { - SkPoint strokeMid; - SkEvalQuadAt(stroke, SK_ScalarHalf, &strokeMid); + SkPoint strokeMid = SkEvalQuadAt(stroke, SK_ScalarHalf); // measure the distance from the curve to the quad-stroke midpoint, compare to radius if (points_within_dist(ray[0], strokeMid, fInvResScaleSquared)) { // if the difference is small if (sharp_angle(quadPts->fQuad)) { @@ -935,8 +934,7 @@ SkPathStroker::ResultType SkPathStroker::strokeCloseEnough(const SkPoint stroke[ return STROKER_RESULT(kSplit_ResultType, depth, quadPts, "rootCount=%d != 1", rootCount); } - SkPoint quadPt; - SkEvalQuadAt(stroke, roots[0], &quadPt); + SkPoint quadPt = SkEvalQuadAt(stroke, roots[0]); SkScalar error = fInvResScale * (SK_Scalar1 - SkScalarAbs(roots[0] - 0.5f) * 2); if (points_within_dist(ray[0], quadPt, error)) { // if the difference is small, we're done if (sharp_angle(quadPts->fQuad)) { |