Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: src/effects/SkBlurMaskFilter.cpp

Issue 938943002: Allow GrGpuResources' unique keys to be changed. (Closed) Base URL: https://skia.googlesource.com/skia.git@rename
Patch Set: Address comments Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/gpu/GrResourceKey.h ('k') | src/effects/SkColorCubeFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 if (NULL == *blurProfileTexture) { 770 if (NULL == *blurProfileTexture) {
771 771
772 SkBlurMask::ComputeBlurProfile(sigma, &profile); 772 SkBlurMask::ComputeBlurProfile(sigma, &profile);
773 ada.reset(profile); 773 ada.reset(profile);
774 774
775 *blurProfileTexture = context->createTexture(texDesc, true, profile, 0); 775 *blurProfileTexture = context->createTexture(texDesc, true, profile, 0);
776 776
777 if (NULL == *blurProfileTexture) { 777 if (NULL == *blurProfileTexture) {
778 return false; 778 return false;
779 } 779 }
780 SkAssertResult(context->addResourceToCache(key, *blurProfileTexture)); 780 context->addResourceToCache(key, *blurProfileTexture);
781 } 781 }
782 782
783 return true; 783 return true;
784 } 784 }
785 785
786 GrRectBlurEffect::GrRectBlurEffect(const SkRect& rect, float sigma, 786 GrRectBlurEffect::GrRectBlurEffect(const SkRect& rect, float sigma,
787 GrTexture *blur_profile) 787 GrTexture *blur_profile)
788 : fRect(rect), 788 : fRect(rect),
789 fSigma(sigma), 789 fSigma(sigma),
790 fBlurProfileAccess(blur_profile) { 790 fBlurProfileAccess(blur_profile) {
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 SkBlurMask::BoxBlur(&blurred_mask, mask, sigma, kNormal_SkBlurStyle, kHi gh_SkBlurQuality, 955 SkBlurMask::BoxBlur(&blurred_mask, mask, sigma, kNormal_SkBlurStyle, kHi gh_SkBlurQuality,
956 NULL, true ); 956 NULL, true );
957 957
958 unsigned int texSide = smallRectSide + 2*blurRadius; 958 unsigned int texSide = smallRectSide + 2*blurRadius;
959 GrSurfaceDesc texDesc; 959 GrSurfaceDesc texDesc;
960 texDesc.fWidth = texSide; 960 texDesc.fWidth = texSide;
961 texDesc.fHeight = texSide; 961 texDesc.fHeight = texSide;
962 texDesc.fConfig = kAlpha_8_GrPixelConfig; 962 texDesc.fConfig = kAlpha_8_GrPixelConfig;
963 963
964 blurNinePatchTexture = context->createTexture(texDesc, true, blurred_mas k.fImage, 0); 964 blurNinePatchTexture = context->createTexture(texDesc, true, blurred_mas k.fImage, 0);
965 SkAssertResult(context->addResourceToCache(key, blurNinePatchTexture)); 965 context->addResourceToCache(key, blurNinePatchTexture);
966 966
967 SkMask::FreeImage(blurred_mask.fImage); 967 SkMask::FreeImage(blurred_mask.fImage);
968 } 968 }
969 969
970 SkAutoTUnref<GrTexture> blurunref(blurNinePatchTexture); 970 SkAutoTUnref<GrTexture> blurunref(blurNinePatchTexture);
971 if (NULL == blurNinePatchTexture) { 971 if (NULL == blurNinePatchTexture) {
972 return NULL; 972 return NULL;
973 } 973 }
974 974
975 return SkNEW_ARGS(GrRRectBlurEffect, (sigma, rrect, blurNinePatchTexture)); 975 return SkNEW_ARGS(GrRRectBlurEffect, (sigma, rrect, blurNinePatchTexture));
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 } else { 1266 } else {
1267 str->append("None"); 1267 str->append("None");
1268 } 1268 }
1269 str->append("))"); 1269 str->append("))");
1270 } 1270 }
1271 #endif 1271 #endif
1272 1272
1273 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) 1273 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter)
1274 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) 1274 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl)
1275 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1275 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « include/gpu/GrResourceKey.h ('k') | src/effects/SkColorCubeFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698