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

Unified Diff: src/gpu/GrStyle.cpp

Issue 1954123002: Fix issue where GrStyle::applyToPath exited before applying stroke (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix comments Created 4 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/GrStyle.h ('k') | tests/GrShapeTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrStyle.cpp
diff --git a/src/gpu/GrStyle.cpp b/src/gpu/GrStyle.cpp
index 6480fb341a48a61219bc31488607d645d6dd08e8..68238dded9eeedb8a2a12ea98db524333c5fc46b 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());
« no previous file with comments | « src/gpu/GrStyle.h ('k') | tests/GrShapeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698