| 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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 GrGLFragmentProcessor* GrRectBlurEffect::createGLInstance() const { | 810 GrGLFragmentProcessor* GrRectBlurEffect::createGLInstance() const { |
| 811 return SkNEW_ARGS(GrGLRectBlurEffect, (*this)); | 811 return SkNEW_ARGS(GrGLRectBlurEffect, (*this)); |
| 812 } | 812 } |
| 813 | 813 |
| 814 bool GrRectBlurEffect::onIsEqual(const GrFragmentProcessor& sBase) const { | 814 bool GrRectBlurEffect::onIsEqual(const GrFragmentProcessor& sBase) const { |
| 815 const GrRectBlurEffect& s = sBase.cast<GrRectBlurEffect>(); | 815 const GrRectBlurEffect& s = sBase.cast<GrRectBlurEffect>(); |
| 816 return this->getSigma() == s.getSigma() && this->getRect() == s.getRect(); | 816 return this->getSigma() == s.getSigma() && this->getRect() == s.getRect(); |
| 817 } | 817 } |
| 818 | 818 |
| 819 void GrRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
{ | 819 void GrRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
{ |
| 820 inout->mulByUnknownAlpha(); | 820 inout->mulByUnknownSingleComponent(); |
| 821 } | 821 } |
| 822 | 822 |
| 823 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRectBlurEffect); | 823 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRectBlurEffect); |
| 824 | 824 |
| 825 GrFragmentProcessor* GrRectBlurEffect::TestCreate(SkRandom* random, | 825 GrFragmentProcessor* GrRectBlurEffect::TestCreate(SkRandom* random, |
| 826 GrContext* context, | 826 GrContext* context, |
| 827 const GrDrawTargetCaps&, | 827 const GrDrawTargetCaps&, |
| 828 GrTexture**) { | 828 GrTexture**) { |
| 829 float sigma = random->nextRangeF(3,8); | 829 float sigma = random->nextRangeF(3,8); |
| 830 float width = random->nextRangeF(200,300); | 830 float width = random->nextRangeF(200,300); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 | 972 |
| 973 SkAutoTUnref<GrTexture> blurunref(blurNinePatchTexture); | 973 SkAutoTUnref<GrTexture> blurunref(blurNinePatchTexture); |
| 974 if (NULL == blurNinePatchTexture) { | 974 if (NULL == blurNinePatchTexture) { |
| 975 return NULL; | 975 return NULL; |
| 976 } | 976 } |
| 977 | 977 |
| 978 return SkNEW_ARGS(GrRRectBlurEffect, (sigma, rrect, blurNinePatchTexture)); | 978 return SkNEW_ARGS(GrRRectBlurEffect, (sigma, rrect, blurNinePatchTexture)); |
| 979 } | 979 } |
| 980 | 980 |
| 981 void GrRRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
{ | 981 void GrRRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
{ |
| 982 inout->mulByUnknownAlpha(); | 982 inout->mulByUnknownSingleComponent(); |
| 983 } | 983 } |
| 984 | 984 |
| 985 GrRRectBlurEffect::GrRRectBlurEffect(float sigma, const SkRRect& rrect, GrTextur
e *ninePatchTexture) | 985 GrRRectBlurEffect::GrRRectBlurEffect(float sigma, const SkRRect& rrect, GrTextur
e *ninePatchTexture) |
| 986 : fRRect(rrect), | 986 : fRRect(rrect), |
| 987 fSigma(sigma), | 987 fSigma(sigma), |
| 988 fNinePatchAccess(ninePatchTexture) { | 988 fNinePatchAccess(ninePatchTexture) { |
| 989 this->initClassID<GrRRectBlurEffect>(); | 989 this->initClassID<GrRRectBlurEffect>(); |
| 990 this->addTextureAccess(&fNinePatchAccess); | 990 this->addTextureAccess(&fNinePatchAccess); |
| 991 this->setWillReadFragmentPosition(); | 991 this->setWillReadFragmentPosition(); |
| 992 } | 992 } |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1268 } else { | 1268 } else { |
| 1269 str->append("None"); | 1269 str->append("None"); |
| 1270 } | 1270 } |
| 1271 str->append("))"); | 1271 str->append("))"); |
| 1272 } | 1272 } |
| 1273 #endif | 1273 #endif |
| 1274 | 1274 |
| 1275 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1275 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
| 1276 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1276 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
| 1277 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1277 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |