Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: src/effects/SkBlurMaskFilter.cpp

Issue 354663002: Make GrGLShaderBuilder::fragmentPosition() return a vec4, with 1.0 as the zw components when in the… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: line wraps Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/gpu/GrAARectRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 &cornerRadiusName); 1008 &cornerRadiusName);
1009 fBlurRadiusUniform = builder->addUniform(GrGLShaderBuilder::kFragment_Visibi lity, 1009 fBlurRadiusUniform = builder->addUniform(GrGLShaderBuilder::kFragment_Visibi lity,
1010 kFloat_GrSLType, 1010 kFloat_GrSLType,
1011 "blurRadius", 1011 "blurRadius",
1012 &blurRadiusName); 1012 &blurRadiusName);
1013 const char* fragmentPos = builder->fragmentPosition(); 1013 const char* fragmentPos = builder->fragmentPosition();
1014 1014
1015 // warp the fragment position to the appropriate part of the 9patch blur tex ture 1015 // warp the fragment position to the appropriate part of the 9patch blur tex ture
1016 1016
1017 builder->fsCodeAppendf("\t\tvec2 rectCenter = (%s.xy + %s.zw)/2.0;\n", rectN ame, rectName); 1017 builder->fsCodeAppendf("\t\tvec2 rectCenter = (%s.xy + %s.zw)/2.0;\n", rectN ame, rectName);
1018 builder->fsCodeAppendf("\t\tvec2 translatedFragPos = %s - %s.xy;\n", fragmen tPos, rectName); 1018 builder->fsCodeAppendf("\t\tvec2 translatedFragPos = %s.xy - %s.xy;\n", frag mentPos, rectName);
1019 builder->fsCodeAppendf("\t\tfloat threshold = %s + 2.0*%s;\n", cornerRadiusN ame, blurRadiusName ); 1019 builder->fsCodeAppendf("\t\tfloat threshold = %s + 2.0*%s;\n", cornerRadiusN ame, blurRadiusName );
1020 builder->fsCodeAppendf("\t\tvec2 middle = %s.zw - %s.xy - 2.0*threshold;\n", rectName, rectName ); 1020 builder->fsCodeAppendf("\t\tvec2 middle = %s.zw - %s.xy - 2.0*threshold;\n", rectName, rectName );
1021 1021
1022 builder->fsCodeAppendf("\t\tif (translatedFragPos.x >= threshold && translat edFragPos.x < (middle.x+threshold)) {\n" ); 1022 builder->fsCodeAppendf("\t\tif (translatedFragPos.x >= threshold && translat edFragPos.x < (middle.x+threshold)) {\n" );
1023 builder->fsCodeAppendf("\t\t\ttranslatedFragPos.x = threshold;\n"); 1023 builder->fsCodeAppendf("\t\t\ttranslatedFragPos.x = threshold;\n");
1024 builder->fsCodeAppendf("\t\t} else if (translatedFragPos.x >= (middle.x + th reshold)) {\n"); 1024 builder->fsCodeAppendf("\t\t} else if (translatedFragPos.x >= (middle.x + th reshold)) {\n");
1025 builder->fsCodeAppendf("\t\t\ttranslatedFragPos.x -= middle.x - 1.0;\n"); 1025 builder->fsCodeAppendf("\t\t\ttranslatedFragPos.x -= middle.x - 1.0;\n");
1026 builder->fsCodeAppendf("\t\t}\n"); 1026 builder->fsCodeAppendf("\t\t}\n");
1027 1027
1028 builder->fsCodeAppendf("\t\tif (translatedFragPos.y > threshold && translate dFragPos.y < (middle.y+threshold)) {\n" ); 1028 builder->fsCodeAppendf("\t\tif (translatedFragPos.y > threshold && translate dFragPos.y < (middle.y+threshold)) {\n" );
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 } else { 1207 } else {
1208 str->append("None"); 1208 str->append("None");
1209 } 1209 }
1210 str->append("))"); 1210 str->append("))");
1211 } 1211 }
1212 #endif 1212 #endif
1213 1213
1214 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) 1214 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter)
1215 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) 1215 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl)
1216 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1216 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrAARectRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698