| 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" |
| 11 #include "SkGpuBlurUtils.h" | 11 #include "SkGpuBlurUtils.h" |
| 12 #include "SkReadBuffer.h" | 12 #include "SkReadBuffer.h" |
| 13 #include "SkWriteBuffer.h" | 13 #include "SkWriteBuffer.h" |
| 14 #include "SkMaskFilter.h" | 14 #include "SkMaskFilter.h" |
| 15 #include "SkRRect.h" | 15 #include "SkRRect.h" |
| 16 #include "SkRTConf.h" | 16 #include "SkRTConf.h" |
| 17 #include "SkStringUtils.h" | 17 #include "SkStringUtils.h" |
| 18 #include "SkStrokeRec.h" | 18 #include "SkStrokeRec.h" |
| 19 | 19 |
| 20 #if SK_SUPPORT_GPU | 20 #if SK_SUPPORT_GPU |
| 21 #include "GrContext.h" | 21 #include "GrContext.h" |
| 22 #include "GrTexture.h" | 22 #include "GrTexture.h" |
| 23 #include "GrFragmentProcessor.h" | 23 #include "GrFragmentProcessor.h" |
| 24 #include "GrInvariantOutput.h" | 24 #include "GrInvariantOutput.h" |
| 25 #include "SkGrPixelRef.h" |
| 26 #include "SkDraw.h" |
| 27 #include "effects/GrSimpleTextureEffect.h" |
| 25 #include "gl/GrGLProcessor.h" | 28 #include "gl/GrGLProcessor.h" |
| 26 #include "gl/builders/GrGLProgramBuilder.h" | 29 #include "gl/builders/GrGLProgramBuilder.h" |
| 27 #include "effects/GrSimpleTextureEffect.h" | |
| 28 #include "GrTBackendProcessorFactory.h" | |
| 29 #include "SkGrPixelRef.h" | |
| 30 #include "SkDraw.h" | |
| 31 #endif | 30 #endif |
| 32 | 31 |
| 33 SkScalar SkBlurMaskFilter::ConvertRadiusToSigma(SkScalar radius) { | 32 SkScalar SkBlurMaskFilter::ConvertRadiusToSigma(SkScalar radius) { |
| 34 return SkBlurMask::ConvertRadiusToSigma(radius); | 33 return SkBlurMask::ConvertRadiusToSigma(radius); |
| 35 } | 34 } |
| 36 | 35 |
| 37 class SkBlurMaskFilterImpl : public SkMaskFilter { | 36 class SkBlurMaskFilterImpl : public SkMaskFilter { |
| 38 public: | 37 public: |
| 39 SkBlurMaskFilterImpl(SkScalar sigma, SkBlurStyle, uint32_t flags); | 38 SkBlurMaskFilterImpl(SkScalar sigma, SkBlurStyle, uint32_t flags); |
| 40 | 39 |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 } | 601 } |
| 603 | 602 |
| 604 #if SK_SUPPORT_GPU | 603 #if SK_SUPPORT_GPU |
| 605 | 604 |
| 606 class GrGLRectBlurEffect; | 605 class GrGLRectBlurEffect; |
| 607 | 606 |
| 608 class GrRectBlurEffect : public GrFragmentProcessor { | 607 class GrRectBlurEffect : public GrFragmentProcessor { |
| 609 public: | 608 public: |
| 610 virtual ~GrRectBlurEffect(); | 609 virtual ~GrRectBlurEffect(); |
| 611 | 610 |
| 612 static const char* Name() { return "RectBlur"; } | 611 virtual const char* name() const SK_OVERRIDE { return "RectBlur"; } |
| 613 | 612 |
| 614 typedef GrGLRectBlurEffect GLProcessor; | 613 virtual void getGLProcessorKey(const GrGLCaps& caps, |
| 614 GrProcessorKeyBuilder* b) const SK_OVERRIDE; |
| 615 | 615 |
| 616 virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR
IDE; | 616 virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE; |
| 617 |
| 617 /** | 618 /** |
| 618 * Create a simple filter effect with custom bicubic coefficients. | 619 * Create a simple filter effect with custom bicubic coefficients. |
| 619 */ | 620 */ |
| 620 static GrFragmentProcessor* Create(GrContext *context, const SkRect& rect, f
loat sigma) { | 621 static GrFragmentProcessor* Create(GrContext *context, const SkRect& rect, f
loat sigma) { |
| 621 GrTexture *blurProfileTexture = NULL; | 622 GrTexture *blurProfileTexture = NULL; |
| 622 int doubleProfileSize = SkScalarCeilToInt(12*sigma); | 623 int doubleProfileSize = SkScalarCeilToInt(12*sigma); |
| 623 | 624 |
| 624 if (doubleProfileSize >= rect.width() || doubleProfileSize >= rect.heigh
t()) { | 625 if (doubleProfileSize >= rect.width() || doubleProfileSize >= rect.heigh
t()) { |
| 625 // if the blur sigma is too large so the gaussian overlaps the whole | 626 // if the blur sigma is too large so the gaussian overlaps the whole |
| 626 // rect in either direction, fall back to CPU path for now. | 627 // rect in either direction, fall back to CPU path for now. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 652 float fSigma; | 653 float fSigma; |
| 653 GrTextureAccess fBlurProfileAccess; | 654 GrTextureAccess fBlurProfileAccess; |
| 654 | 655 |
| 655 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 656 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 656 | 657 |
| 657 typedef GrFragmentProcessor INHERITED; | 658 typedef GrFragmentProcessor INHERITED; |
| 658 }; | 659 }; |
| 659 | 660 |
| 660 class GrGLRectBlurEffect : public GrGLFragmentProcessor { | 661 class GrGLRectBlurEffect : public GrGLFragmentProcessor { |
| 661 public: | 662 public: |
| 662 GrGLRectBlurEffect(const GrBackendProcessorFactory& factory, | 663 GrGLRectBlurEffect(const GrProcessor&) {} |
| 663 const GrProcessor&); | |
| 664 virtual void emitCode(GrGLFPBuilder*, | 664 virtual void emitCode(GrGLFPBuilder*, |
| 665 const GrFragmentProcessor&, | 665 const GrFragmentProcessor&, |
| 666 const char* outputColor, | 666 const char* outputColor, |
| 667 const char* inputColor, | 667 const char* inputColor, |
| 668 const TransformedCoordsArray&, | 668 const TransformedCoordsArray&, |
| 669 const TextureSamplerArray&) SK_OVERRIDE; | 669 const TextureSamplerArray&) SK_OVERRIDE; |
| 670 | 670 |
| 671 virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_O
VERRIDE; | 671 virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_O
VERRIDE; |
| 672 | 672 |
| 673 private: | 673 private: |
| 674 typedef GrGLProgramDataManager::UniformHandle UniformHandle; | 674 typedef GrGLProgramDataManager::UniformHandle UniformHandle; |
| 675 | 675 |
| 676 UniformHandle fProxyRectUniform; | 676 UniformHandle fProxyRectUniform; |
| 677 UniformHandle fProfileSizeUniform; | 677 UniformHandle fProfileSizeUniform; |
| 678 | 678 |
| 679 typedef GrGLFragmentProcessor INHERITED; | 679 typedef GrGLFragmentProcessor INHERITED; |
| 680 }; | 680 }; |
| 681 | 681 |
| 682 | |
| 683 | |
| 684 GrGLRectBlurEffect::GrGLRectBlurEffect(const GrBackendProcessorFactory& factory,
const GrProcessor&) | |
| 685 : INHERITED(factory) { | |
| 686 } | |
| 687 | |
| 688 void OutputRectBlurProfileLookup(GrGLFPFragmentBuilder* fsBuilder, | 682 void OutputRectBlurProfileLookup(GrGLFPFragmentBuilder* fsBuilder, |
| 689 const GrGLShaderBuilder::TextureSampler& sample
r, | 683 const GrGLShaderBuilder::TextureSampler& sample
r, |
| 690 const char *output, | 684 const char *output, |
| 691 const char *profileSize, const char *loc, | 685 const char *profileSize, const char *loc, |
| 692 const char *blurred_width, | 686 const char *blurred_width, |
| 693 const char *sharp_width) { | 687 const char *sharp_width) { |
| 694 fsBuilder->codeAppendf("\tfloat %s;\n", output); | 688 fsBuilder->codeAppendf("\tfloat %s;\n", output); |
| 695 fsBuilder->codeAppendf("\t\t{\n"); | 689 fsBuilder->codeAppendf("\t\t{\n"); |
| 696 fsBuilder->codeAppendf("\t\t\tfloat coord = (0.5 * (abs(2.0*%s - %s) - %s))/
%s;\n", | 690 fsBuilder->codeAppendf("\t\t\tfloat coord = (0.5 * (abs(2.0*%s - %s) - %s))/
%s;\n", |
| 697 loc, blurred_width, sharp_width, profileSize); | 691 loc, blurred_width, sharp_width, profileSize); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 787 if (NULL == *blurProfileTexture) { | 781 if (NULL == *blurProfileTexture) { |
| 788 return false; | 782 return false; |
| 789 } | 783 } |
| 790 } | 784 } |
| 791 | 785 |
| 792 return true; | 786 return true; |
| 793 } | 787 } |
| 794 | 788 |
| 795 GrRectBlurEffect::GrRectBlurEffect(const SkRect& rect, float sigma, | 789 GrRectBlurEffect::GrRectBlurEffect(const SkRect& rect, float sigma, |
| 796 GrTexture *blur_profile) | 790 GrTexture *blur_profile) |
| 797 : INHERITED(), | 791 : fRect(rect), |
| 798 fRect(rect), | |
| 799 fSigma(sigma), | 792 fSigma(sigma), |
| 800 fBlurProfileAccess(blur_profile) { | 793 fBlurProfileAccess(blur_profile) { |
| 794 this->initClassID<GrRectBlurEffect>(); |
| 801 this->addTextureAccess(&fBlurProfileAccess); | 795 this->addTextureAccess(&fBlurProfileAccess); |
| 802 this->setWillReadFragmentPosition(); | 796 this->setWillReadFragmentPosition(); |
| 803 } | 797 } |
| 804 | 798 |
| 805 GrRectBlurEffect::~GrRectBlurEffect() { | 799 GrRectBlurEffect::~GrRectBlurEffect() { |
| 806 } | 800 } |
| 807 | 801 |
| 808 const GrBackendFragmentProcessorFactory& GrRectBlurEffect::getFactory() const { | 802 void GrRectBlurEffect::getGLProcessorKey(const GrGLCaps& caps, |
| 809 return GrTBackendFragmentProcessorFactory<GrRectBlurEffect>::getInstance(); | 803 GrProcessorKeyBuilder* b) const { |
| 804 GrGLRectBlurEffect::GenKey(*this, caps, b); |
| 805 } |
| 806 |
| 807 GrGLFragmentProcessor* GrRectBlurEffect::createGLInstance() const { |
| 808 return SkNEW_ARGS(GrGLRectBlurEffect, (*this)); |
| 810 } | 809 } |
| 811 | 810 |
| 812 bool GrRectBlurEffect::onIsEqual(const GrFragmentProcessor& sBase) const { | 811 bool GrRectBlurEffect::onIsEqual(const GrFragmentProcessor& sBase) const { |
| 813 const GrRectBlurEffect& s = sBase.cast<GrRectBlurEffect>(); | 812 const GrRectBlurEffect& s = sBase.cast<GrRectBlurEffect>(); |
| 814 return this->getSigma() == s.getSigma() && this->getRect() == s.getRect(); | 813 return this->getSigma() == s.getSigma() && this->getRect() == s.getRect(); |
| 815 } | 814 } |
| 816 | 815 |
| 817 void GrRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
{ | 816 void GrRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
{ |
| 818 inout->mulByUnknownAlpha(); | 817 inout->mulByUnknownAlpha(); |
| 819 } | 818 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 if (!am.setIdentity(context, grp)) { | 862 if (!am.setIdentity(context, grp)) { |
| 864 return false; | 863 return false; |
| 865 } | 864 } |
| 866 | 865 |
| 867 grp->addCoverageProcessor(fp); | 866 grp->addCoverageProcessor(fp); |
| 868 | 867 |
| 869 context->drawRect(*grp, rect); | 868 context->drawRect(*grp, rect); |
| 870 return true; | 869 return true; |
| 871 } | 870 } |
| 872 | 871 |
| 873 class GrGLRRectBlurEffect; | |
| 874 | |
| 875 class GrRRectBlurEffect : public GrFragmentProcessor { | 872 class GrRRectBlurEffect : public GrFragmentProcessor { |
| 876 public: | 873 public: |
| 877 | 874 |
| 878 static GrFragmentProcessor* Create(GrContext* context, float sigma, const Sk
RRect&); | 875 static GrFragmentProcessor* Create(GrContext* context, float sigma, const Sk
RRect&); |
| 879 | 876 |
| 880 virtual ~GrRRectBlurEffect() {}; | 877 virtual ~GrRRectBlurEffect() {}; |
| 881 static const char* Name() { return "GrRRectBlur"; } | 878 virtual const char* name() const SK_OVERRIDE { return "GrRRectBlur"; } |
| 882 | 879 |
| 883 const SkRRect& getRRect() const { return fRRect; } | 880 const SkRRect& getRRect() const { return fRRect; } |
| 884 float getSigma() const { return fSigma; } | 881 float getSigma() const { return fSigma; } |
| 885 | 882 |
| 886 typedef GrGLRRectBlurEffect GLProcessor; | 883 virtual void getGLProcessorKey(const GrGLCaps& caps, |
| 884 GrProcessorKeyBuilder* b) const SK_OVERRIDE; |
| 887 | 885 |
| 888 virtual const GrBackendFragmentProcessorFactory& getFactory() const SK_OVERR
IDE; | 886 virtual GrGLFragmentProcessor* createGLInstance() const SK_OVERRIDE; |
| 889 | 887 |
| 890 private: | 888 private: |
| 891 GrRRectBlurEffect(float sigma, const SkRRect&, GrTexture* profileTexture); | 889 GrRRectBlurEffect(float sigma, const SkRRect&, GrTexture* profileTexture); |
| 892 | 890 |
| 893 virtual bool onIsEqual(const GrFragmentProcessor& other) const SK_OVERRIDE; | 891 virtual bool onIsEqual(const GrFragmentProcessor& other) const SK_OVERRIDE; |
| 894 | 892 |
| 895 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE; | 893 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE; |
| 896 | 894 |
| 897 SkRRect fRRect; | 895 SkRRect fRRect; |
| 898 float fSigma; | 896 float fSigma; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 return NULL; | 972 return NULL; |
| 975 } | 973 } |
| 976 | 974 |
| 977 return SkNEW_ARGS(GrRRectBlurEffect, (sigma, rrect, blurNinePatchTexture)); | 975 return SkNEW_ARGS(GrRRectBlurEffect, (sigma, rrect, blurNinePatchTexture)); |
| 978 } | 976 } |
| 979 | 977 |
| 980 void GrRRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
{ | 978 void GrRRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
{ |
| 981 inout->mulByUnknownAlpha(); | 979 inout->mulByUnknownAlpha(); |
| 982 } | 980 } |
| 983 | 981 |
| 984 const GrBackendFragmentProcessorFactory& GrRRectBlurEffect::getFactory() const { | |
| 985 return GrTBackendFragmentProcessorFactory<GrRRectBlurEffect>::getInstance(); | |
| 986 } | |
| 987 | |
| 988 GrRRectBlurEffect::GrRRectBlurEffect(float sigma, const SkRRect& rrect, GrTextur
e *ninePatchTexture) | 982 GrRRectBlurEffect::GrRRectBlurEffect(float sigma, const SkRRect& rrect, GrTextur
e *ninePatchTexture) |
| 989 : fRRect(rrect), | 983 : fRRect(rrect), |
| 990 fSigma(sigma), | 984 fSigma(sigma), |
| 991 fNinePatchAccess(ninePatchTexture) { | 985 fNinePatchAccess(ninePatchTexture) { |
| 986 this->initClassID<GrRRectBlurEffect>(); |
| 992 this->addTextureAccess(&fNinePatchAccess); | 987 this->addTextureAccess(&fNinePatchAccess); |
| 993 this->setWillReadFragmentPosition(); | 988 this->setWillReadFragmentPosition(); |
| 994 } | 989 } |
| 995 | 990 |
| 996 bool GrRRectBlurEffect::onIsEqual(const GrFragmentProcessor& other) const { | 991 bool GrRRectBlurEffect::onIsEqual(const GrFragmentProcessor& other) const { |
| 997 const GrRRectBlurEffect& rrbe = other.cast<GrRRectBlurEffect>(); | 992 const GrRRectBlurEffect& rrbe = other.cast<GrRRectBlurEffect>(); |
| 998 return fRRect.getSimpleRadii().fX == rrbe.fRRect.getSimpleRadii().fX && fSig
ma == rrbe.fSigma; | 993 return fRRect.getSimpleRadii().fX == rrbe.fRRect.getSimpleRadii().fX && fSig
ma == rrbe.fSigma; |
| 999 } | 994 } |
| 1000 | 995 |
| 1001 ////////////////////////////////////////////////////////////////////////////// | 996 ////////////////////////////////////////////////////////////////////////////// |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1012 SkScalar sigma = random->nextRangeF(1.f,10.f); | 1007 SkScalar sigma = random->nextRangeF(1.f,10.f); |
| 1013 SkRRect rrect; | 1008 SkRRect rrect; |
| 1014 rrect.setRectXY(SkRect::MakeWH(w, h), r, r); | 1009 rrect.setRectXY(SkRect::MakeWH(w, h), r, r); |
| 1015 return GrRRectBlurEffect::Create(context, sigma, rrect); | 1010 return GrRRectBlurEffect::Create(context, sigma, rrect); |
| 1016 } | 1011 } |
| 1017 | 1012 |
| 1018 ////////////////////////////////////////////////////////////////////////////// | 1013 ////////////////////////////////////////////////////////////////////////////// |
| 1019 | 1014 |
| 1020 class GrGLRRectBlurEffect : public GrGLFragmentProcessor { | 1015 class GrGLRRectBlurEffect : public GrGLFragmentProcessor { |
| 1021 public: | 1016 public: |
| 1022 GrGLRRectBlurEffect(const GrBackendProcessorFactory&, const GrProcessor&); | 1017 GrGLRRectBlurEffect(const GrProcessor&) {} |
| 1023 | 1018 |
| 1024 virtual void emitCode(GrGLFPBuilder*, | 1019 virtual void emitCode(GrGLFPBuilder*, |
| 1025 const GrFragmentProcessor&, | 1020 const GrFragmentProcessor&, |
| 1026 const char* outputColor, | 1021 const char* outputColor, |
| 1027 const char* inputColor, | 1022 const char* inputColor, |
| 1028 const TransformedCoordsArray&, | 1023 const TransformedCoordsArray&, |
| 1029 const TextureSamplerArray&) SK_OVERRIDE; | 1024 const TextureSamplerArray&) SK_OVERRIDE; |
| 1030 | 1025 |
| 1031 virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_O
VERRIDE; | 1026 virtual void setData(const GrGLProgramDataManager&, const GrProcessor&) SK_O
VERRIDE; |
| 1032 | 1027 |
| 1033 private: | 1028 private: |
| 1034 GrGLProgramDataManager::UniformHandle fProxyRectUniform; | 1029 GrGLProgramDataManager::UniformHandle fProxyRectUniform; |
| 1035 GrGLProgramDataManager::UniformHandle fCornerRadiusUniform; | 1030 GrGLProgramDataManager::UniformHandle fCornerRadiusUniform; |
| 1036 GrGLProgramDataManager::UniformHandle fBlurRadiusUniform; | 1031 GrGLProgramDataManager::UniformHandle fBlurRadiusUniform; |
| 1037 typedef GrGLFragmentProcessor INHERITED; | 1032 typedef GrGLFragmentProcessor INHERITED; |
| 1038 }; | 1033 }; |
| 1039 | 1034 |
| 1040 GrGLRRectBlurEffect::GrGLRRectBlurEffect(const GrBackendProcessorFactory& factor
y, | |
| 1041 const GrProcessor&) | |
| 1042 : INHERITED (factory) { | |
| 1043 } | |
| 1044 | |
| 1045 void GrGLRRectBlurEffect::emitCode(GrGLFPBuilder* builder, | 1035 void GrGLRRectBlurEffect::emitCode(GrGLFPBuilder* builder, |
| 1046 const GrFragmentProcessor&, | 1036 const GrFragmentProcessor&, |
| 1047 const char* outputColor, | 1037 const char* outputColor, |
| 1048 const char* inputColor, | 1038 const char* inputColor, |
| 1049 const TransformedCoordsArray&, | 1039 const TransformedCoordsArray&, |
| 1050 const TextureSamplerArray& samplers) { | 1040 const TextureSamplerArray& samplers) { |
| 1051 const char *rectName; | 1041 const char *rectName; |
| 1052 const char *cornerRadiusName; | 1042 const char *cornerRadiusName; |
| 1053 const char *blurRadiusName; | 1043 const char *blurRadiusName; |
| 1054 | 1044 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 SkRect rect = rrect.getBounds(); | 1099 SkRect rect = rrect.getBounds(); |
| 1110 rect.outset(blurRadius, blurRadius); | 1100 rect.outset(blurRadius, blurRadius); |
| 1111 pdman.set4f(fProxyRectUniform, rect.fLeft, rect.fTop, rect.fRight, rect.fBot
tom); | 1101 pdman.set4f(fProxyRectUniform, rect.fLeft, rect.fTop, rect.fRight, rect.fBot
tom); |
| 1112 | 1102 |
| 1113 SkScalar radius = 0; | 1103 SkScalar radius = 0; |
| 1114 SkASSERT(rrect.isSimpleCircular() || rrect.isRect()); | 1104 SkASSERT(rrect.isSimpleCircular() || rrect.isRect()); |
| 1115 radius = rrect.getSimpleRadii().fX; | 1105 radius = rrect.getSimpleRadii().fX; |
| 1116 pdman.set1f(fCornerRadiusUniform, radius); | 1106 pdman.set1f(fCornerRadiusUniform, radius); |
| 1117 } | 1107 } |
| 1118 | 1108 |
| 1109 void GrRRectBlurEffect::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBu
ilder* b) const { |
| 1110 GrGLRRectBlurEffect::GenKey(*this, caps, b); |
| 1111 } |
| 1112 |
| 1113 GrGLFragmentProcessor* GrRRectBlurEffect::createGLInstance() const { |
| 1114 return SkNEW_ARGS(GrGLRRectBlurEffect, (*this)); |
| 1115 } |
| 1119 | 1116 |
| 1120 bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrContext* context, | 1117 bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrContext* context, |
| 1121 GrPaint* grp, | 1118 GrPaint* grp, |
| 1122 const SkStrokeRec& strokeRec
, | 1119 const SkStrokeRec& strokeRec
, |
| 1123 const SkRRect& rrect) const
{ | 1120 const SkRRect& rrect) const
{ |
| 1124 if (fBlurStyle != kNormal_SkBlurStyle) { | 1121 if (fBlurStyle != kNormal_SkBlurStyle) { |
| 1125 return false; | 1122 return false; |
| 1126 } | 1123 } |
| 1127 | 1124 |
| 1128 if (!strokeRec.isFillStyle()) { | 1125 if (!strokeRec.isFillStyle()) { |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1265 } else { | 1262 } else { |
| 1266 str->append("None"); | 1263 str->append("None"); |
| 1267 } | 1264 } |
| 1268 str->append("))"); | 1265 str->append("))"); |
| 1269 } | 1266 } |
| 1270 #endif | 1267 #endif |
| 1271 | 1268 |
| 1272 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) | 1269 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) |
| 1273 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) | 1270 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) |
| 1274 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1271 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
| OLD | NEW |