| 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 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 const SkRect& getRect() const { return fRect; } | 643 const SkRect& getRect() const { return fRect; } |
| 644 float getSigma() const { return fSigma; } | 644 float getSigma() const { return fSigma; } |
| 645 | 645 |
| 646 private: | 646 private: |
| 647 GrRectBlurEffect(const SkRect& rect, float sigma, GrTexture *blur_profile); | 647 GrRectBlurEffect(const SkRect& rect, float sigma, GrTexture *blur_profile); |
| 648 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE; | 648 virtual bool onIsEqual(const GrFragmentProcessor&) const SK_OVERRIDE; |
| 649 | 649 |
| 650 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE; | 650 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE; |
| 651 | 651 |
| 652 static bool CreateBlurProfileTexture(GrContext *context, float sigma, | 652 static bool CreateBlurProfileTexture(GrContext *context, float sigma, |
| 653 GrTexture **blurProfileTexture); | 653 GrTexture **blurProfileTexture); |
| 654 | 654 |
| 655 SkRect fRect; | 655 SkRect fRect; |
| 656 float fSigma; | 656 float fSigma; |
| 657 GrTextureAccess fBlurProfileAccess; | 657 GrTextureAccess fBlurProfileAccess; |
| 658 | 658 |
| 659 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 659 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 660 | 660 |
| 661 typedef GrFragmentProcessor INHERITED; | 661 typedef GrFragmentProcessor INHERITED; |
| 662 }; | 662 }; |
| 663 | 663 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 void GrGLRectBlurEffect::setData(const GrGLProgramDataManager& pdman, | 746 void GrGLRectBlurEffect::setData(const GrGLProgramDataManager& pdman, |
| 747 const GrProcessor& proc) { | 747 const GrProcessor& proc) { |
| 748 const GrRectBlurEffect& rbe = proc.cast<GrRectBlurEffect>(); | 748 const GrRectBlurEffect& rbe = proc.cast<GrRectBlurEffect>(); |
| 749 SkRect rect = rbe.getRect(); | 749 SkRect rect = rbe.getRect(); |
| 750 | 750 |
| 751 pdman.set4f(fProxyRectUniform, rect.fLeft, rect.fTop, rect.fRight, rect.fBot
tom); | 751 pdman.set4f(fProxyRectUniform, rect.fLeft, rect.fTop, rect.fRight, rect.fBot
tom); |
| 752 pdman.set1f(fProfileSizeUniform, SkScalarCeilToScalar(6*rbe.getSigma())); | 752 pdman.set1f(fProfileSizeUniform, SkScalarCeilToScalar(6*rbe.getSigma())); |
| 753 } | 753 } |
| 754 | 754 |
| 755 bool GrRectBlurEffect::CreateBlurProfileTexture(GrContext *context, float sigma, | 755 bool GrRectBlurEffect::CreateBlurProfileTexture(GrContext *context, float sigma, |
| 756 GrTexture **blurProfileTexture) { | 756 GrTexture **blurProfileTexture)
{ |
| 757 GrTextureParams params; | 757 GrTextureParams params; |
| 758 GrSurfaceDesc texDesc; | 758 GrSurfaceDesc texDesc; |
| 759 | 759 |
| 760 unsigned int profile_size = SkScalarCeilToInt(6*sigma); | 760 unsigned int profile_size = SkScalarCeilToInt(6*sigma); |
| 761 | 761 |
| 762 texDesc.fWidth = profile_size; | 762 texDesc.fWidth = profile_size; |
| 763 texDesc.fHeight = 1; | 763 texDesc.fHeight = 1; |
| 764 texDesc.fConfig = kAlpha_8_GrPixelConfig; | 764 texDesc.fConfig = kAlpha_8_GrPixelConfig; |
| 765 | 765 |
| 766 static const GrCacheID::Domain gBlurProfileDomain = GrCacheID::GenerateDomai
n(); | 766 static const GrCacheID::Domain gBlurProfileDomain = GrCacheID::GenerateDomai
n(); |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1269 } else { | 1269 } else { |
| 1270 str->append("None"); | 1270 str->append("None"); |
| 1271 } | 1271 } |
| 1272 str->append("))"); | 1272 str->append("))"); |
| 1273 } | 1273 } |
| 1274 #endif | 1274 #endif |
| 1275 | 1275 |
| 1276 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1276 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
| 1277 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1277 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
| 1278 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1278 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |