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

Side by Side Diff: src/core/SkDraw.cpp

Issue 269903002: Revert of fix the error that path is inversed for stroke and strokeAndFill styles (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkStroke.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkDraw.h" 8 #include "SkDraw.h"
9 #include "SkBlitter.h" 9 #include "SkBlitter.h"
10 #include "SkBounder.h" 10 #include "SkBounder.h"
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 } 1112 }
1113 1113
1114 // avoid possibly allocating a new path in transform if we can 1114 // avoid possibly allocating a new path in transform if we can
1115 SkPath* devPathPtr = pathIsMutable ? pathPtr : &tmpPath; 1115 SkPath* devPathPtr = pathIsMutable ? pathPtr : &tmpPath;
1116 1116
1117 // transform the path into device space 1117 // transform the path into device space
1118 pathPtr->transform(*matrix, devPathPtr); 1118 pathPtr->transform(*matrix, devPathPtr);
1119 1119
1120 SkAutoBlitterChoose blitter(*fBitmap, *fMatrix, *paint, drawCoverage); 1120 SkAutoBlitterChoose blitter(*fBitmap, *fMatrix, *paint, drawCoverage);
1121 1121
1122 // make sure the path will not be inverse-stroked. hairlineStroke + fill = f ill,
1123 // they can be inverse-filled.
1124 if (devPathPtr->isInverseFillType() && (SkPaint::kStroke_Style == paint->get Style() ||
1125 (SkPaint::kStrokeAndFill_Style == paint->getStyle() && paint->getStr okeWidth() > 0))) {
1126 devPathPtr->toggleInverseFillType();
1127 }
1128
1129 if (paint->getMaskFilter()) { 1122 if (paint->getMaskFilter()) {
1130 SkPaint::Style style = doFill ? SkPaint::kFill_Style : 1123 SkPaint::Style style = doFill ? SkPaint::kFill_Style :
1131 SkPaint::kStroke_Style; 1124 SkPaint::kStroke_Style;
1132 if (paint->getMaskFilter()->filterPath(*devPathPtr, *fMatrix, *fRC, 1125 if (paint->getMaskFilter()->filterPath(*devPathPtr, *fMatrix, *fRC,
1133 fBounder, blitter.get(), 1126 fBounder, blitter.get(),
1134 style)) { 1127 style)) {
1135 return; // filterPath() called the blitter, so we're done 1128 return; // filterPath() called the blitter, so we're done
1136 } 1129 }
1137 } 1130 }
1138 1131
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after
2836 mask->fImage = SkMask::AllocImage(size); 2829 mask->fImage = SkMask::AllocImage(size);
2837 memset(mask->fImage, 0, mask->computeImageSize()); 2830 memset(mask->fImage, 0, mask->computeImageSize());
2838 } 2831 }
2839 2832
2840 if (SkMask::kJustComputeBounds_CreateMode != mode) { 2833 if (SkMask::kJustComputeBounds_CreateMode != mode) {
2841 draw_into_mask(*mask, devPath, style); 2834 draw_into_mask(*mask, devPath, style);
2842 } 2835 }
2843 2836
2844 return true; 2837 return true;
2845 } 2838 }
OLDNEW
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkStroke.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698