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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 // rect in either direction, fall back to CPU path for now. | 565 // rect in either direction, fall back to CPU path for now. |
566 | 566 |
567 return NULL; | 567 return NULL; |
568 } | 568 } |
569 | 569 |
570 bool createdBlurProfileTexture = CreateBlurProfileTexture(context, sigma
, &blurProfileTexture); | 570 bool createdBlurProfileTexture = CreateBlurProfileTexture(context, sigma
, &blurProfileTexture); |
571 SkAutoTUnref<GrTexture> hunref(blurProfileTexture); | 571 SkAutoTUnref<GrTexture> hunref(blurProfileTexture); |
572 if (!createdBlurProfileTexture) { | 572 if (!createdBlurProfileTexture) { |
573 return NULL; | 573 return NULL; |
574 } | 574 } |
575 AutoEffectUnref effect(SkNEW_ARGS(GrRectBlurEffect, (rect, sigma, blurPr
ofileTexture))); | 575 return SkNEW_ARGS(GrRectBlurEffect, (rect, sigma, blurProfileTexture)); |
576 return CreateEffectRef(effect); | |
577 } | 576 } |
578 | 577 |
579 const SkRect& getRect() const { return fRect; } | 578 const SkRect& getRect() const { return fRect; } |
580 float getSigma() const { return fSigma; } | 579 float getSigma() const { return fSigma; } |
581 | 580 |
582 private: | 581 private: |
583 GrRectBlurEffect(const SkRect& rect, float sigma, GrTexture *blur_profile); | 582 GrRectBlurEffect(const SkRect& rect, float sigma, GrTexture *blur_profile); |
584 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; | 583 virtual bool onIsEqual(const GrEffect&) const SK_OVERRIDE; |
585 | 584 |
586 static bool CreateBlurProfileTexture(GrContext *context, float sigma, | 585 static bool CreateBlurProfileTexture(GrContext *context, float sigma, |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 | 906 |
908 blurNinePatchTexture = context->createTexture(¶ms, texDesc, blurRRec
tNinePatchID, blurred_mask.fImage, 0); | 907 blurNinePatchTexture = context->createTexture(¶ms, texDesc, blurRRec
tNinePatchID, blurred_mask.fImage, 0); |
909 SkMask::FreeImage(blurred_mask.fImage); | 908 SkMask::FreeImage(blurred_mask.fImage); |
910 } | 909 } |
911 | 910 |
912 SkAutoTUnref<GrTexture> blurunref(blurNinePatchTexture); | 911 SkAutoTUnref<GrTexture> blurunref(blurNinePatchTexture); |
913 if (NULL == blurNinePatchTexture) { | 912 if (NULL == blurNinePatchTexture) { |
914 return NULL; | 913 return NULL; |
915 } | 914 } |
916 | 915 |
917 return CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(GrRRectBlurEffect, | 916 return SkNEW_ARGS(GrRRectBlurEffect, (sigma, rrect, blurNinePatchTexture)); |
918 (sigma, rrect, blurNinePat
chTexture)))); | |
919 } | 917 } |
920 | 918 |
921 void GrRRectBlurEffect::getConstantColorComponents(GrColor* color, uint32_t* val
idFlags) const { | 919 void GrRRectBlurEffect::getConstantColorComponents(GrColor* color, uint32_t* val
idFlags) const { |
922 *validFlags = 0; | 920 *validFlags = 0; |
923 } | 921 } |
924 | 922 |
925 const GrBackendEffectFactory& GrRRectBlurEffect::getFactory() const { | 923 const GrBackendEffectFactory& GrRRectBlurEffect::getFactory() const { |
926 return GrTBackendEffectFactory<GrRRectBlurEffect>::getInstance(); | 924 return GrTBackendEffectFactory<GrRRectBlurEffect>::getInstance(); |
927 } | 925 } |
928 | 926 |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 } else { | 1205 } else { |
1208 str->append("None"); | 1206 str->append("None"); |
1209 } | 1207 } |
1210 str->append("))"); | 1208 str->append("))"); |
1211 } | 1209 } |
1212 #endif | 1210 #endif |
1213 | 1211 |
1214 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1212 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
1215 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1213 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
1216 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1214 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |