OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
10 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 static bool draw_rects_into_mask(const SkRect rects[], int count, SkMask* mask)
{ | 235 static bool draw_rects_into_mask(const SkRect rects[], int count, SkMask* mask)
{ |
236 if (!prepare_to_draw_into_mask(rects[0], mask)) { | 236 if (!prepare_to_draw_into_mask(rects[0], mask)) { |
237 return false; | 237 return false; |
238 } | 238 } |
239 | 239 |
240 SkBitmap bitmap; | 240 SkBitmap bitmap; |
241 bitmap.installPixels(SkImageInfo::Make(mask->fBounds.width(), | 241 bitmap.installPixels(SkImageInfo::Make(mask->fBounds.width(), |
242 mask->fBounds.height(), | 242 mask->fBounds.height(), |
243 kAlpha_8_SkColorType, | 243 kAlpha_8_SkColorType, |
244 kPremul_SkAlphaType), | 244 kPremul_SkAlphaType), |
245 mask->fImage, mask->fRowBytes, NULL, NULL); | 245 mask->fImage, mask->fRowBytes); |
246 | 246 |
247 SkCanvas canvas(bitmap); | 247 SkCanvas canvas(bitmap); |
248 canvas.translate(-SkIntToScalar(mask->fBounds.left()), | 248 canvas.translate(-SkIntToScalar(mask->fBounds.left()), |
249 -SkIntToScalar(mask->fBounds.top())); | 249 -SkIntToScalar(mask->fBounds.top())); |
250 | 250 |
251 SkPaint paint; | 251 SkPaint paint; |
252 paint.setAntiAlias(true); | 252 paint.setAntiAlias(true); |
253 | 253 |
254 if (1 == count) { | 254 if (1 == count) { |
255 canvas.drawRect(rects[0], paint); | 255 canvas.drawRect(rects[0], paint); |
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 } else { | 1224 } else { |
1225 str->append("None"); | 1225 str->append("None"); |
1226 } | 1226 } |
1227 str->append("))"); | 1227 str->append("))"); |
1228 } | 1228 } |
1229 #endif | 1229 #endif |
1230 | 1230 |
1231 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1231 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
1232 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1232 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
1233 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1233 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |