diff options
author | bsalomon <bsalomon@google.com> | 2015-05-04 11:41:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-04 11:41:57 -0700 |
commit | 07ab9f3beda017d06089797de8c79d833b5a7659 (patch) | |
tree | 8caac8015957571d59d9659238523af8349a8a2c /src/gpu | |
parent | 8415abe44cf205ac214b7793c076fd8c13272240 (diff) |
Don't attempt to draw path if dashing or stroking fails
TBR=egdaniel@google.com
Committed: https://skia.googlesource.com/skia/+/39202f12d37b6ef69ffaddcaa8cc92c621fcda41
Review URL: https://codereview.chromium.org/1119393002
Diffstat (limited to 'src/gpu')
-rwxr-xr-x | src/gpu/GrContext.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 819774a076..5ffb32727f 100755 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -1325,33 +1325,36 @@ void GrContext::internalDrawPath(GrDrawTarget* target, GrStrokeInfo dashlessStrokeInfo(strokeInfo, false); if (NULL == pr && strokeInfo.isDashed()) { // It didn't work above, so try again with dashed stroke converted to a dashless stroke. - if (strokeInfo.applyDash(tmpPath.init(), &dashlessStrokeInfo, *pathPtr)) { - pathPtr = tmpPath.get(); - if (pathPtr->isEmpty()) { - return; - } - strokeInfoPtr = &dashlessStrokeInfo; + if (!strokeInfo.applyDash(tmpPath.init(), &dashlessStrokeInfo, *pathPtr)) { + return; + } + pathPtr = tmpPath.get(); + if (pathPtr->isEmpty()) { + return; } + strokeInfoPtr = &dashlessStrokeInfo; pr = this->getPathRenderer(target, pipelineBuilder, viewMatrix, *pathPtr, *strokeInfoPtr, false, type); } if (NULL == pr) { - if (!GrPathRenderer::IsStrokeHairlineOrEquivalent(*strokeInfoPtr, viewMatrix, NULL)) { + if (!GrPathRenderer::IsStrokeHairlineOrEquivalent(*strokeInfoPtr, viewMatrix, NULL) && + !strokeInfoPtr->isFillStyle()) { // It didn't work above, so try again with stroke converted to a fill. if (!tmpPath.isValid()) { tmpPath.init(); } SkStrokeRec* strokeRec = dashlessStrokeInfo.getStrokeRecPtr(); strokeRec->setResScale(SkScalarAbs(viewMatrix.getMaxScale())); - if (strokeRec->applyToPath(tmpPath.get(), *pathPtr)) { - pathPtr = tmpPath.get(); - if (pathPtr->isEmpty()) { - return; - } - strokeRec->setFillStyle(); - strokeInfoPtr = &dashlessStrokeInfo; + if (!strokeRec->applyToPath(tmpPath.get(), *pathPtr)) { + return; + } + pathPtr = tmpPath.get(); + if (pathPtr->isEmpty()) { + return; } + strokeRec->setFillStyle(); + strokeInfoPtr = &dashlessStrokeInfo; } // This time, allow SW renderer |