diff options
author | bsalomon <bsalomon@google.com> | 2016-05-06 11:07:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-06 11:07:04 -0700 |
commit | 1a0b9ed7d8e16a8ebc34732b5e54246003921423 (patch) | |
tree | f0fa04c9308db0223d25d3593ccdbd3caada65bf /src/gpu/GrStyle.cpp | |
parent | 4d0cd764771a6c52ae80157d2915baa4844944c8 (diff) |
Fix issue where GrStyle::applyToPath exited before applying stroke
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1954123002
Review-Url: https://codereview.chromium.org/1954123002
Diffstat (limited to 'src/gpu/GrStyle.cpp')
-rw-r--r-- | src/gpu/GrStyle.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gpu/GrStyle.cpp b/src/gpu/GrStyle.cpp index 6480fb341a..68238dded9 100644 --- a/src/gpu/GrStyle.cpp +++ b/src/gpu/GrStyle.cpp @@ -137,14 +137,20 @@ bool GrStyle::applyToPath(SkPath* dst, SkStrokeRec::InitStyle* style, const SkPa SkASSERT(style); SkASSERT(dst); SkStrokeRec strokeRec = fStrokeRec; - if (!apply_path_effect(dst, &strokeRec, fPathEffect, src)) { + const SkPath* pathForStrokeRec = &src; + if (apply_path_effect(dst, &strokeRec, fPathEffect, src)) { + pathForStrokeRec = dst; + } else if (fPathEffect) { return false; } if (strokeRec.needToApply()) { - if (!strokeRec.applyToPath(dst, *dst)) { + if (!strokeRec.applyToPath(dst, *pathForStrokeRec)) { return false; } *style = SkStrokeRec::kFill_InitStyle; + } else if (!fPathEffect) { + // Nothing to do for path effect or stroke, fail. + return false; } else { SkASSERT(SkStrokeRec::kFill_Style == strokeRec.getStyle() || SkStrokeRec::kHairline_Style == strokeRec.getStyle()); |