Index: src/effects/SkMorphologyImageFilter.cpp |
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp |
index 251938e500c31feb6dd4df9ee71e7c88c87f8de9..fbc071fe5887b7f8464df407895ce560ef9c4bc7 100644 |
--- a/src/effects/SkMorphologyImageFilter.cpp |
+++ b/src/effects/SkMorphologyImageFilter.cpp |
@@ -297,16 +297,16 @@ void GrGLMorphologyEffect::emitCode(EmitArgs& args) { |
"Range"); |
const char* range = args.fBuilder->getUniformCStr(fRangeUni); |
- GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder(); |
- SkString coords2D = fsBuilder->ensureFSCoords2D(args.fCoords, 0); |
+ GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; |
+ SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0); |
const char* func; |
switch (fType) { |
case GrMorphologyEffect::kErode_MorphologyType: |
- fsBuilder->codeAppendf("\t\t%s = vec4(1, 1, 1, 1);\n", args.fOutputColor); |
+ fragBuilder->codeAppendf("\t\t%s = vec4(1, 1, 1, 1);\n", args.fOutputColor); |
func = "min"; |
break; |
case GrMorphologyEffect::kDilate_MorphologyType: |
- fsBuilder->codeAppendf("\t\t%s = vec4(0, 0, 0, 0);\n", args.fOutputColor); |
+ fragBuilder->codeAppendf("\t\t%s = vec4(0, 0, 0, 0);\n", args.fOutputColor); |
func = "max"; |
break; |
default: |
@@ -329,30 +329,30 @@ void GrGLMorphologyEffect::emitCode(EmitArgs& args) { |
} |
// vec2 coord = coord2D; |
- fsBuilder->codeAppendf("\t\tvec2 coord = %s;\n", coords2D.c_str()); |
+ fragBuilder->codeAppendf("\t\tvec2 coord = %s;\n", coords2D.c_str()); |
// coord.x -= radius * pixelSize; |
- fsBuilder->codeAppendf("\t\tcoord.%s -= %d.0 * %s; \n", dir, fRadius, pixelSizeInc); |
+ fragBuilder->codeAppendf("\t\tcoord.%s -= %d.0 * %s; \n", dir, fRadius, pixelSizeInc); |
if (fUseRange) { |
// highBound = min(highBound, coord.x + (width-1) * pixelSize); |
- fsBuilder->codeAppendf("\t\tfloat highBound = min(%s.y, coord.%s + %f * %s);", |
- range, dir, float(width() - 1), pixelSizeInc); |
+ fragBuilder->codeAppendf("\t\tfloat highBound = min(%s.y, coord.%s + %f * %s);", |
+ range, dir, float(width() - 1), pixelSizeInc); |
// coord.x = max(lowBound, coord.x); |
- fsBuilder->codeAppendf("\t\tcoord.%s = max(%s.x, coord.%s);", dir, range, dir); |
+ fragBuilder->codeAppendf("\t\tcoord.%s = max(%s.x, coord.%s);", dir, range, dir); |
} |
- fsBuilder->codeAppendf("\t\tfor (int i = 0; i < %d; i++) {\n", width()); |
- fsBuilder->codeAppendf("\t\t\t%s = %s(%s, ", args.fOutputColor, func, args.fOutputColor); |
- fsBuilder->appendTextureLookup(args.fSamplers[0], "coord"); |
- fsBuilder->codeAppend(");\n"); |
+ fragBuilder->codeAppendf("\t\tfor (int i = 0; i < %d; i++) {\n", width()); |
+ fragBuilder->codeAppendf("\t\t\t%s = %s(%s, ", args.fOutputColor, func, args.fOutputColor); |
+ fragBuilder->appendTextureLookup(args.fSamplers[0], "coord"); |
+ fragBuilder->codeAppend(");\n"); |
// coord.x += pixelSize; |
- fsBuilder->codeAppendf("\t\t\tcoord.%s += %s;\n", dir, pixelSizeInc); |
+ fragBuilder->codeAppendf("\t\t\tcoord.%s += %s;\n", dir, pixelSizeInc); |
if (fUseRange) { |
// coord.x = min(highBound, coord.x); |
- fsBuilder->codeAppendf("\t\t\tcoord.%s = min(highBound, coord.%s);", dir, dir); |
+ fragBuilder->codeAppendf("\t\t\tcoord.%s = min(highBound, coord.%s);", dir, dir); |
} |
- fsBuilder->codeAppend("\t\t}\n"); |
+ fragBuilder->codeAppend("\t\t}\n"); |
SkString modulate; |
GrGLSLMulVarBy4f(&modulate, args.fOutputColor, args.fInputColor); |
- fsBuilder->codeAppend(modulate.c_str()); |
+ fragBuilder->codeAppend(modulate.c_str()); |
} |
void GrGLMorphologyEffect::GenKey(const GrProcessor& proc, |