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

Unified Diff: src/gpu/GrContext.cpp

Issue 183683010: fix the error that path is inversed for stroke and strokeAndFill styles (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix the error when path inversed for StrokeAndFill style Created 6 years, 8 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/core/SkDraw.cpp ('k') | src/gpu/GrStencilAndCoverPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 90bf8c042e498cc2e1ec3f2547f1ea586a919b51..0f64e2126e6361da21191c0dd1eb3286426ec472 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1207,6 +1207,11 @@ void GrContext::internalDrawPath(GrDrawTarget* target, bool useAA, const SkPath&
if (!GrPathRenderer::IsStrokeHairlineOrEquivalent(*stroke, this->getMatrix(), NULL)) {
// It didn't work the 1st time, so try again with the stroked path
if (stroke->applyToPath(tmpPath.init(), *pathPtr)) {
+ // make sure the path will not be inverse-stroked
bsalomon 2014/04/23 15:06:12 Shouldn't applyToPath just return a path with the
yunchao 2014/04/24 16:12:43 applyToPath doesn't change the style. For a stroke
bsalomon 2014/04/24 17:33:21 It *should* set the correct fill type.
+ if (SkStrokeRec::kFill_Style != stroke->getStyle() &&
+ tmpPath.get()->isInverseFillType()) {
+ tmpPath.get()->toggleInverseFillType();
+ }
pathPtr = tmpPath.get();
stroke.writable()->setFillStyle();
if (pathPtr->isEmpty()) {
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/gpu/GrStencilAndCoverPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698