| 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 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 1122 if (paint->getMaskFilter()) { | 1129 if (paint->getMaskFilter()) { |
| 1123 SkPaint::Style style = doFill ? SkPaint::kFill_Style : | 1130 SkPaint::Style style = doFill ? SkPaint::kFill_Style : |
| 1124 SkPaint::kStroke_Style; | 1131 SkPaint::kStroke_Style; |
| 1125 if (paint->getMaskFilter()->filterPath(*devPathPtr, *fMatrix, *fRC, | 1132 if (paint->getMaskFilter()->filterPath(*devPathPtr, *fMatrix, *fRC, |
| 1126 fBounder, blitter.get(), | 1133 fBounder, blitter.get(), |
| 1127 style)) { | 1134 style)) { |
| 1128 return; // filterPath() called the blitter, so we're done | 1135 return; // filterPath() called the blitter, so we're done |
| 1129 } | 1136 } |
| 1130 } | 1137 } |
| 1131 | 1138 |
| (...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2829 mask->fImage = SkMask::AllocImage(size); | 2836 mask->fImage = SkMask::AllocImage(size); |
| 2830 memset(mask->fImage, 0, mask->computeImageSize()); | 2837 memset(mask->fImage, 0, mask->computeImageSize()); |
| 2831 } | 2838 } |
| 2832 | 2839 |
| 2833 if (SkMask::kJustComputeBounds_CreateMode != mode) { | 2840 if (SkMask::kJustComputeBounds_CreateMode != mode) { |
| 2834 draw_into_mask(*mask, devPath, style); | 2841 draw_into_mask(*mask, devPath, style); |
| 2835 } | 2842 } |
| 2836 | 2843 |
| 2837 return true; | 2844 return true; |
| 2838 } | 2845 } |
| OLD | NEW |