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 #define __STDC_LIMIT_MACROS | 7 #define __STDC_LIMIT_MACROS |
8 | 8 |
9 #include "SkDraw.h" | 9 #include "SkDraw.h" |
10 #include "SkBlitter.h" | 10 #include "SkBlitter.h" |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 case SkPaint::kSquare_Cap: | 1139 case SkPaint::kSquare_Cap: |
1140 proc = SkScan::AntiHairSquarePath; | 1140 proc = SkScan::AntiHairSquarePath; |
1141 break; | 1141 break; |
1142 case SkPaint::kRound_Cap: | 1142 case SkPaint::kRound_Cap: |
1143 proc = SkScan::AntiHairRoundPath; | 1143 proc = SkScan::AntiHairRoundPath; |
1144 break; | 1144 break; |
1145 default: | 1145 default: |
1146 proc SK_INIT_TO_AVOID_WARNING; | 1146 proc SK_INIT_TO_AVOID_WARNING; |
1147 SkDEBUGFAIL("unknown paint cap type"); | 1147 SkDEBUGFAIL("unknown paint cap type"); |
1148 } | 1148 } |
1149 #ifdef SK_SUPPORT_LEGACY_HAIR_IGNORES_CAPS | |
1150 proc = SkScan::AntiHairPath; | |
1151 #endif | |
1152 } else { | 1149 } else { |
1153 switch (paint->getStrokeCap()) { | 1150 switch (paint->getStrokeCap()) { |
1154 case SkPaint::kButt_Cap: | 1151 case SkPaint::kButt_Cap: |
1155 proc = SkScan::HairPath; | 1152 proc = SkScan::HairPath; |
1156 break; | 1153 break; |
1157 case SkPaint::kSquare_Cap: | 1154 case SkPaint::kSquare_Cap: |
1158 proc = SkScan::HairSquarePath; | 1155 proc = SkScan::HairSquarePath; |
1159 break; | 1156 break; |
1160 case SkPaint::kRound_Cap: | 1157 case SkPaint::kRound_Cap: |
1161 proc = SkScan::HairRoundPath; | 1158 proc = SkScan::HairRoundPath; |
1162 break; | 1159 break; |
1163 default: | 1160 default: |
1164 proc SK_INIT_TO_AVOID_WARNING; | 1161 proc SK_INIT_TO_AVOID_WARNING; |
1165 SkDEBUGFAIL("unknown paint cap type"); | 1162 SkDEBUGFAIL("unknown paint cap type"); |
1166 } | 1163 } |
1167 #ifdef SK_SUPPORT_LEGACY_HAIR_IGNORES_CAPS | |
1168 proc = SkScan::HairPath; | |
1169 #endif | |
1170 } | 1164 } |
1171 } | 1165 } |
1172 proc(*devPathPtr, *fRC, blitter); | 1166 proc(*devPathPtr, *fRC, blitter); |
1173 } | 1167 } |
1174 | 1168 |
1175 void SkDraw::drawBitmapAsMask(const SkBitmap& bitmap, | 1169 void SkDraw::drawBitmapAsMask(const SkBitmap& bitmap, |
1176 const SkPaint& paint) const { | 1170 const SkPaint& paint) const { |
1177 SkASSERT(bitmap.colorType() == kAlpha_8_SkColorType); | 1171 SkASSERT(bitmap.colorType() == kAlpha_8_SkColorType); |
1178 | 1172 |
1179 if (SkTreatAsSprite(*fMatrix, bitmap.dimensions(), paint)) { | 1173 if (SkTreatAsSprite(*fMatrix, bitmap.dimensions(), paint)) { |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2068 mask->fImage = SkMask::AllocImage(size); | 2062 mask->fImage = SkMask::AllocImage(size); |
2069 memset(mask->fImage, 0, mask->computeImageSize()); | 2063 memset(mask->fImage, 0, mask->computeImageSize()); |
2070 } | 2064 } |
2071 | 2065 |
2072 if (SkMask::kJustComputeBounds_CreateMode != mode) { | 2066 if (SkMask::kJustComputeBounds_CreateMode != mode) { |
2073 draw_into_mask(*mask, devPath, style); | 2067 draw_into_mask(*mask, devPath, style); |
2074 } | 2068 } |
2075 | 2069 |
2076 return true; | 2070 return true; |
2077 } | 2071 } |
OLD | NEW |