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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 uint8_t *profile = NULL; | 764 uint8_t *profile = NULL; |
765 SkAutoTDeleteArray<uint8_t> ada(NULL); | 765 SkAutoTDeleteArray<uint8_t> ada(NULL); |
766 | 766 |
767 *blurProfileTexture = context->findAndRefCachedTexture(key); | 767 *blurProfileTexture = context->findAndRefCachedTexture(key); |
768 | 768 |
769 if (NULL == *blurProfileTexture) { | 769 if (NULL == *blurProfileTexture) { |
770 | 770 |
771 SkBlurMask::ComputeBlurProfile(sigma, &profile); | 771 SkBlurMask::ComputeBlurProfile(sigma, &profile); |
772 ada.reset(profile); | 772 ada.reset(profile); |
773 | 773 |
774 *blurProfileTexture = context->createTexture(texDesc, profile, 0); | 774 *blurProfileTexture = context->createTexture(texDesc, true, profile, 0); |
775 | 775 |
776 if (NULL == *blurProfileTexture) { | 776 if (NULL == *blurProfileTexture) { |
777 return false; | 777 return false; |
778 } | 778 } |
779 SkAssertResult(context->addResourceToCache(key, *blurProfileTexture)); | 779 SkAssertResult(context->addResourceToCache(key, *blurProfileTexture)); |
780 } | 780 } |
781 | 781 |
782 return true; | 782 return true; |
783 } | 783 } |
784 | 784 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 SkMask blurred_mask; | 952 SkMask blurred_mask; |
953 SkBlurMask::BoxBlur(&blurred_mask, mask, sigma, kNormal_SkBlurStyle, kHi
gh_SkBlurQuality, | 953 SkBlurMask::BoxBlur(&blurred_mask, mask, sigma, kNormal_SkBlurStyle, kHi
gh_SkBlurQuality, |
954 NULL, true ); | 954 NULL, true ); |
955 | 955 |
956 unsigned int texSide = smallRectSide + 2*blurRadius; | 956 unsigned int texSide = smallRectSide + 2*blurRadius; |
957 GrSurfaceDesc texDesc; | 957 GrSurfaceDesc texDesc; |
958 texDesc.fWidth = texSide; | 958 texDesc.fWidth = texSide; |
959 texDesc.fHeight = texSide; | 959 texDesc.fHeight = texSide; |
960 texDesc.fConfig = kAlpha_8_GrPixelConfig; | 960 texDesc.fConfig = kAlpha_8_GrPixelConfig; |
961 | 961 |
962 blurNinePatchTexture = context->createTexture(texDesc, blurred_mask.fIma
ge, 0); | 962 blurNinePatchTexture = context->createTexture(texDesc, true, blurred_mas
k.fImage, 0); |
963 SkAssertResult(context->addResourceToCache(key, blurNinePatchTexture)); | 963 SkAssertResult(context->addResourceToCache(key, blurNinePatchTexture)); |
964 | 964 |
965 SkMask::FreeImage(blurred_mask.fImage); | 965 SkMask::FreeImage(blurred_mask.fImage); |
966 } | 966 } |
967 | 967 |
968 SkAutoTUnref<GrTexture> blurunref(blurNinePatchTexture); | 968 SkAutoTUnref<GrTexture> blurunref(blurNinePatchTexture); |
969 if (NULL == blurNinePatchTexture) { | 969 if (NULL == blurNinePatchTexture) { |
970 return NULL; | 970 return NULL; |
971 } | 971 } |
972 | 972 |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 } else { | 1264 } else { |
1265 str->append("None"); | 1265 str->append("None"); |
1266 } | 1266 } |
1267 str->append("))"); | 1267 str->append("))"); |
1268 } | 1268 } |
1269 #endif | 1269 #endif |
1270 | 1270 |
1271 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1271 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
1272 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1272 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
1273 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1273 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |