| 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 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 | 717 |
| 718 void GrGLRectBlurEffect::emitCode(EmitArgs& args) { | 718 void GrGLRectBlurEffect::emitCode(EmitArgs& args) { |
| 719 const GrRectBlurEffect& rbe = args.fFp.cast<GrRectBlurEffect>(); | 719 const GrRectBlurEffect& rbe = args.fFp.cast<GrRectBlurEffect>(); |
| 720 | 720 |
| 721 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; | 721 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; |
| 722 | 722 |
| 723 const char *rectName; | 723 const char *rectName; |
| 724 const char *profileSizeName; | 724 const char *profileSizeName; |
| 725 | 725 |
| 726 const char* precisionString = GrGLSLShaderVar::PrecisionString(args.fGLSLCap
s, rbe.precision()); | 726 const char* precisionString = GrGLSLShaderVar::PrecisionString(args.fGLSLCap
s, rbe.precision()); |
| 727 fProxyRectUniform = uniformHandler->addUniform(GrGLSLUniformHandler::kFragme
nt_Visibility, | 727 fProxyRectUniform = uniformHandler->addUniform(kFragment_GrShaderFlag, |
| 728 kVec4f_GrSLType, | 728 kVec4f_GrSLType, |
| 729 rbe.precision(), | 729 rbe.precision(), |
| 730 "proxyRect", | 730 "proxyRect", |
| 731 &rectName); | 731 &rectName); |
| 732 fProfileSizeUniform = uniformHandler->addUniform(GrGLSLUniformHandler::kFrag
ment_Visibility, | 732 fProfileSizeUniform = uniformHandler->addUniform(kFragment_GrShaderFlag, |
| 733 kFloat_GrSLType, | 733 kFloat_GrSLType, |
| 734 kDefault_GrSLPrecision, | 734 kDefault_GrSLPrecision, |
| 735 "profileSize", | 735 "profileSize", |
| 736 &profileSizeName); | 736 &profileSizeName); |
| 737 | 737 |
| 738 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; | 738 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; |
| 739 const char *fragmentPos = fragBuilder->fragmentPosition(); | 739 const char *fragmentPos = fragBuilder->fragmentPosition(); |
| 740 | 740 |
| 741 if (args.fInputColor) { | 741 if (args.fInputColor) { |
| 742 fragBuilder->codeAppendf("vec4 src=%s;", args.fInputColor); | 742 fragBuilder->codeAppendf("vec4 src=%s;", args.fInputColor); |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1059 | 1059 |
| 1060 void GrGLRRectBlurEffect::emitCode(EmitArgs& args) { | 1060 void GrGLRRectBlurEffect::emitCode(EmitArgs& args) { |
| 1061 const char *rectName; | 1061 const char *rectName; |
| 1062 const char *cornerRadiusName; | 1062 const char *cornerRadiusName; |
| 1063 const char *blurRadiusName; | 1063 const char *blurRadiusName; |
| 1064 | 1064 |
| 1065 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; | 1065 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; |
| 1066 // The proxy rect has left, top, right, and bottom edges correspond to | 1066 // The proxy rect has left, top, right, and bottom edges correspond to |
| 1067 // components x, y, z, and w, respectively. | 1067 // components x, y, z, and w, respectively. |
| 1068 | 1068 |
| 1069 fProxyRectUniform = uniformHandler->addUniform(GrGLSLUniformHandler::kFragme
nt_Visibility, | 1069 fProxyRectUniform = uniformHandler->addUniform(kFragment_GrShaderFlag, |
| 1070 kVec4f_GrSLType, | 1070 kVec4f_GrSLType, |
| 1071 kDefault_GrSLPrecision, | 1071 kDefault_GrSLPrecision, |
| 1072 "proxyRect", | 1072 "proxyRect", |
| 1073 &rectName); | 1073 &rectName); |
| 1074 fCornerRadiusUniform = uniformHandler->addUniform(GrGLSLUniformHandler::kFra
gment_Visibility, | 1074 fCornerRadiusUniform = uniformHandler->addUniform(kFragment_GrShaderFlag, |
| 1075 kFloat_GrSLType, | 1075 kFloat_GrSLType, |
| 1076 kDefault_GrSLPrecision, | 1076 kDefault_GrSLPrecision, |
| 1077 "cornerRadius", | 1077 "cornerRadius", |
| 1078 &cornerRadiusName); | 1078 &cornerRadiusName); |
| 1079 fBlurRadiusUniform = uniformHandler->addUniform(GrGLSLUniformHandler::kFragm
ent_Visibility, | 1079 fBlurRadiusUniform = uniformHandler->addUniform(kFragment_GrShaderFlag, |
| 1080 kFloat_GrSLType, | 1080 kFloat_GrSLType, |
| 1081 kDefault_GrSLPrecision, | 1081 kDefault_GrSLPrecision, |
| 1082 "blurRadius", | 1082 "blurRadius", |
| 1083 &blurRadiusName); | 1083 &blurRadiusName); |
| 1084 | 1084 |
| 1085 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; | 1085 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; |
| 1086 const char* fragmentPos = fragBuilder->fragmentPosition(); | 1086 const char* fragmentPos = fragBuilder->fragmentPosition(); |
| 1087 | 1087 |
| 1088 // warp the fragment position to the appropriate part of the 9patch blur tex
ture | 1088 // warp the fragment position to the appropriate part of the 9patch blur tex
ture |
| 1089 | 1089 |
| (...skipping 214 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 |