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 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
759 const GrBackendFragmentProcessorFactory& GrRectBlurEffect::getFactory() const { | 759 const GrBackendFragmentProcessorFactory& GrRectBlurEffect::getFactory() const { |
760 return GrTBackendFragmentProcessorFactory<GrRectBlurEffect>::getInstance(); | 760 return GrTBackendFragmentProcessorFactory<GrRectBlurEffect>::getInstance(); |
761 } | 761 } |
762 | 762 |
763 bool GrRectBlurEffect::onIsEqual(const GrProcessor& sBase) const { | 763 bool GrRectBlurEffect::onIsEqual(const GrProcessor& sBase) const { |
764 const GrRectBlurEffect& s = sBase.cast<GrRectBlurEffect>(); | 764 const GrRectBlurEffect& s = sBase.cast<GrRectBlurEffect>(); |
765 return this->getSigma() == s.getSigma() && this->getRect() == s.getRect(); | 765 return this->getSigma() == s.getSigma() && this->getRect() == s.getRect(); |
766 } | 766 } |
767 | 767 |
768 void GrRectBlurEffect::onComputeInvariantOutput(InvariantOutput* inout) const { | 768 void GrRectBlurEffect::onComputeInvariantOutput(InvariantOutput* inout) const { |
769 inout->fValidFlags = 0; | 769 inout->unknownOutput(); |
bsalomon
2014/10/10 19:48:16
I think this can be mulByUnknownAlpha()
egdaniel
2014/10/13 16:44:57
Done.
| |
770 inout->fIsSingleComponent = false; | |
771 } | 770 } |
772 | 771 |
773 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRectBlurEffect); | 772 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRectBlurEffect); |
774 | 773 |
775 GrFragmentProcessor* GrRectBlurEffect::TestCreate(SkRandom* random, | 774 GrFragmentProcessor* GrRectBlurEffect::TestCreate(SkRandom* random, |
776 GrContext* context, | 775 GrContext* context, |
777 const GrDrawTargetCaps&, | 776 const GrDrawTargetCaps&, |
778 GrTexture**) { | 777 GrTexture**) { |
779 float sigma = random->nextRangeF(3,8); | 778 float sigma = random->nextRangeF(3,8); |
780 float width = random->nextRangeF(200,300); | 779 float width = random->nextRangeF(200,300); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
923 | 922 |
924 SkAutoTUnref<GrTexture> blurunref(blurNinePatchTexture); | 923 SkAutoTUnref<GrTexture> blurunref(blurNinePatchTexture); |
925 if (NULL == blurNinePatchTexture) { | 924 if (NULL == blurNinePatchTexture) { |
926 return NULL; | 925 return NULL; |
927 } | 926 } |
928 | 927 |
929 return SkNEW_ARGS(GrRRectBlurEffect, (sigma, rrect, blurNinePatchTexture)); | 928 return SkNEW_ARGS(GrRRectBlurEffect, (sigma, rrect, blurNinePatchTexture)); |
930 } | 929 } |
931 | 930 |
932 void GrRRectBlurEffect::onComputeInvariantOutput(InvariantOutput* inout) const { | 931 void GrRRectBlurEffect::onComputeInvariantOutput(InvariantOutput* inout) const { |
933 inout->fValidFlags = 0; | 932 inout->unknownOutput(); |
bsalomon
2014/10/10 19:48:16
and this
egdaniel
2014/10/13 16:44:57
Done.
| |
934 inout->fIsSingleComponent = false; | |
935 } | 933 } |
936 | 934 |
937 const GrBackendFragmentProcessorFactory& GrRRectBlurEffect::getFactory() const { | 935 const GrBackendFragmentProcessorFactory& GrRRectBlurEffect::getFactory() const { |
938 return GrTBackendFragmentProcessorFactory<GrRRectBlurEffect>::getInstance(); | 936 return GrTBackendFragmentProcessorFactory<GrRRectBlurEffect>::getInstance(); |
939 } | 937 } |
940 | 938 |
941 GrRRectBlurEffect::GrRRectBlurEffect(float sigma, const SkRRect& rrect, GrTextur e *ninePatchTexture) | 939 GrRRectBlurEffect::GrRRectBlurEffect(float sigma, const SkRRect& rrect, GrTextur e *ninePatchTexture) |
942 : fRRect(rrect), | 940 : fRRect(rrect), |
943 fSigma(sigma), | 941 fSigma(sigma), |
944 fNinePatchAccess(ninePatchTexture) { | 942 fNinePatchAccess(ninePatchTexture) { |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1220 } else { | 1218 } else { |
1221 str->append("None"); | 1219 str->append("None"); |
1222 } | 1220 } |
1223 str->append("))"); | 1221 str->append("))"); |
1224 } | 1222 } |
1225 #endif | 1223 #endif |
1226 | 1224 |
1227 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1225 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
1228 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1226 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
1229 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1227 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |