| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkBlurMaskFilter.h" | 8 #include "SkBlurMaskFilter.h" |
| 9 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
| 10 #include "SkGpuBlurUtils.h" | 10 #include "SkGpuBlurUtils.h" |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 } | 804 } |
| 805 | 805 |
| 806 GrRectBlurEffect::GrRectBlurEffect(const SkRect& rect, float sigma, GrTexture *b
lurProfile, | 806 GrRectBlurEffect::GrRectBlurEffect(const SkRect& rect, float sigma, GrTexture *b
lurProfile, |
| 807 GrSLPrecision precision) | 807 GrSLPrecision precision) |
| 808 : fRect(rect) | 808 : fRect(rect) |
| 809 , fSigma(sigma) | 809 , fSigma(sigma) |
| 810 , fBlurProfileAccess(blurProfile) | 810 , fBlurProfileAccess(blurProfile) |
| 811 , fPrecision(precision) { | 811 , fPrecision(precision) { |
| 812 this->initClassID<GrRectBlurEffect>(); | 812 this->initClassID<GrRectBlurEffect>(); |
| 813 this->addTextureAccess(&fBlurProfileAccess); | 813 this->addTextureAccess(&fBlurProfileAccess); |
| 814 this->setWillReadFragmentPosition(); | 814 this->enableBuiltInState(kFragmentPosition_BuiltInState); |
| 815 } | 815 } |
| 816 | 816 |
| 817 void GrRectBlurEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, | 817 void GrRectBlurEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, |
| 818 GrProcessorKeyBuilder* b) const { | 818 GrProcessorKeyBuilder* b) const { |
| 819 GrGLRectBlurEffect::GenKey(*this, caps, b); | 819 GrGLRectBlurEffect::GenKey(*this, caps, b); |
| 820 } | 820 } |
| 821 | 821 |
| 822 GrGLSLFragmentProcessor* GrRectBlurEffect::onCreateGLSLInstance() const { | 822 GrGLSLFragmentProcessor* GrRectBlurEffect::onCreateGLSLInstance() const { |
| 823 return new GrGLRectBlurEffect; | 823 return new GrGLRectBlurEffect; |
| 824 } | 824 } |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 void GrRRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
{ | 1012 void GrRRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
{ |
| 1013 inout->mulByUnknownSingleComponent(); | 1013 inout->mulByUnknownSingleComponent(); |
| 1014 } | 1014 } |
| 1015 | 1015 |
| 1016 GrRRectBlurEffect::GrRRectBlurEffect(float sigma, const SkRRect& rrect, GrTextur
e *ninePatchTexture) | 1016 GrRRectBlurEffect::GrRRectBlurEffect(float sigma, const SkRRect& rrect, GrTextur
e *ninePatchTexture) |
| 1017 : fRRect(rrect), | 1017 : fRRect(rrect), |
| 1018 fSigma(sigma), | 1018 fSigma(sigma), |
| 1019 fNinePatchAccess(ninePatchTexture) { | 1019 fNinePatchAccess(ninePatchTexture) { |
| 1020 this->initClassID<GrRRectBlurEffect>(); | 1020 this->initClassID<GrRRectBlurEffect>(); |
| 1021 this->addTextureAccess(&fNinePatchAccess); | 1021 this->addTextureAccess(&fNinePatchAccess); |
| 1022 this->setWillReadFragmentPosition(); | 1022 this->enableBuiltInState(kFragmentPosition_BuiltInState); |
| 1023 } | 1023 } |
| 1024 | 1024 |
| 1025 bool GrRRectBlurEffect::onIsEqual(const GrFragmentProcessor& other) const { | 1025 bool GrRRectBlurEffect::onIsEqual(const GrFragmentProcessor& other) const { |
| 1026 const GrRRectBlurEffect& rrbe = other.cast<GrRRectBlurEffect>(); | 1026 const GrRRectBlurEffect& rrbe = other.cast<GrRRectBlurEffect>(); |
| 1027 return fRRect.getSimpleRadii().fX == rrbe.fRRect.getSimpleRadii().fX && fSig
ma == rrbe.fSigma; | 1027 return fRRect.getSimpleRadii().fX == rrbe.fRRect.getSimpleRadii().fX && fSig
ma == rrbe.fSigma; |
| 1028 } | 1028 } |
| 1029 | 1029 |
| 1030 ////////////////////////////////////////////////////////////////////////////// | 1030 ////////////////////////////////////////////////////////////////////////////// |
| 1031 | 1031 |
| 1032 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRRectBlurEffect); | 1032 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRRectBlurEffect); |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1304 } else { | 1304 } else { |
| 1305 str->append("None"); | 1305 str->append("None"); |
| 1306 } | 1306 } |
| 1307 str->append("))"); | 1307 str->append("))"); |
| 1308 } | 1308 } |
| 1309 #endif | 1309 #endif |
| 1310 | 1310 |
| 1311 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1311 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
| 1312 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1312 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
| 1313 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1313 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |