| OLD | NEW |
| 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 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 } | 1111 } |
| 1112 | 1112 |
| 1113 // avoid possibly allocating a new path in transform if we can | 1113 // avoid possibly allocating a new path in transform if we can |
| 1114 SkPath* devPathPtr = pathIsMutable ? pathPtr : &tmpPath; | 1114 SkPath* devPathPtr = pathIsMutable ? pathPtr : &tmpPath; |
| 1115 | 1115 |
| 1116 // transform the path into device space | 1116 // transform the path into device space |
| 1117 pathPtr->transform(*matrix, devPathPtr); | 1117 pathPtr->transform(*matrix, devPathPtr); |
| 1118 | 1118 |
| 1119 SkAutoBlitterChoose blitter(*fBitmap, *fMatrix, *paint, drawCoverage); | 1119 SkAutoBlitterChoose blitter(*fBitmap, *fMatrix, *paint, drawCoverage); |
| 1120 | 1120 |
| 1121 // make sure the path will not be inverse-stroked. hairlineStroke + fill = f
ill, |
| 1122 // they can be inverse-filled. |
| 1123 if (devPathPtr->isInverseFillType() && (SkPaint::kStroke_Style == paint->get
Style() || |
| 1124 (SkPaint::kStrokeAndFill_Style == paint->getStyle() && paint->getStr
okeWidth() > 0))) { |
| 1125 devPathPtr->toggleInverseFillType(); |
| 1126 } |
| 1127 |
| 1121 if (paint->getMaskFilter()) { | 1128 if (paint->getMaskFilter()) { |
| 1122 SkPaint::Style style = doFill ? SkPaint::kFill_Style : | 1129 SkPaint::Style style = doFill ? SkPaint::kFill_Style : |
| 1123 SkPaint::kStroke_Style; | 1130 SkPaint::kStroke_Style; |
| 1124 if (paint->getMaskFilter()->filterPath(*devPathPtr, *fMatrix, *fRC, | 1131 if (paint->getMaskFilter()->filterPath(*devPathPtr, *fMatrix, *fRC, |
| 1125 fBounder, blitter.get(), | 1132 fBounder, blitter.get(), |
| 1126 style)) { | 1133 style)) { |
| 1127 return; // filterPath() called the blitter, so we're done | 1134 return; // filterPath() called the blitter, so we're done |
| 1128 } | 1135 } |
| 1129 } | 1136 } |
| 1130 | 1137 |
| (...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2801 mask->fImage = SkMask::AllocImage(size); | 2808 mask->fImage = SkMask::AllocImage(size); |
| 2802 memset(mask->fImage, 0, mask->computeImageSize()); | 2809 memset(mask->fImage, 0, mask->computeImageSize()); |
| 2803 } | 2810 } |
| 2804 | 2811 |
| 2805 if (SkMask::kJustComputeBounds_CreateMode != mode) { | 2812 if (SkMask::kJustComputeBounds_CreateMode != mode) { |
| 2806 draw_into_mask(*mask, devPath, style); | 2813 draw_into_mask(*mask, devPath, style); |
| 2807 } | 2814 } |
| 2808 | 2815 |
| 2809 return true; | 2816 return true; |
| 2810 } | 2817 } |
| OLD | NEW |