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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } | 188 } |
189 | 189 |
190 static bool draw_rrect_into_mask(const SkRRect rrect, SkMask* mask) { | 190 static bool draw_rrect_into_mask(const SkRRect rrect, SkMask* mask) { |
191 if (!prepare_to_draw_into_mask(rrect.rect(), mask)) { | 191 if (!prepare_to_draw_into_mask(rrect.rect(), mask)) { |
192 return false; | 192 return false; |
193 } | 193 } |
194 | 194 |
195 // FIXME: This code duplicates code in draw_rects_into_mask, below. Is there
a | 195 // FIXME: This code duplicates code in draw_rects_into_mask, below. Is there
a |
196 // clean way to share more code? | 196 // clean way to share more code? |
197 SkBitmap bitmap; | 197 SkBitmap bitmap; |
198 bitmap.installPixels(SkImageInfo::MakeA8(mask->fBounds.width(), | 198 bitmap.installMaskPixels(*mask); |
199 mask->fBounds.height()), | |
200 mask->fImage, mask->fRowBytes, NULL, NULL); | |
201 | 199 |
202 SkCanvas canvas(bitmap); | 200 SkCanvas canvas(bitmap); |
203 canvas.translate(-SkIntToScalar(mask->fBounds.left()), | 201 canvas.translate(-SkIntToScalar(mask->fBounds.left()), |
204 -SkIntToScalar(mask->fBounds.top())); | 202 -SkIntToScalar(mask->fBounds.top())); |
205 | 203 |
206 SkPaint paint; | 204 SkPaint paint; |
207 paint.setAntiAlias(true); | 205 paint.setAntiAlias(true); |
208 canvas.drawRRect(rrect, paint); | 206 canvas.drawRRect(rrect, paint); |
209 return true; | 207 return true; |
210 } | 208 } |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 } else { | 895 } else { |
898 str->append("None"); | 896 str->append("None"); |
899 } | 897 } |
900 str->append("))"); | 898 str->append("))"); |
901 } | 899 } |
902 #endif | 900 #endif |
903 | 901 |
904 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 902 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
905 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 903 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
906 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 904 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |