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

Unified Diff: src/effects/SkBicubicImageFilter.cpp

Issue 23826002: Rename ShaderType enum to ShaderVisibility (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkArithmeticMode.cpp ('k') | src/effects/SkColorMatrixFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBicubicImageFilter.cpp
diff --git a/src/effects/SkBicubicImageFilter.cpp b/src/effects/SkBicubicImageFilter.cpp
index 56d9eba7549ec009389ae04a962ff1a03bf94638..3b2dd4fe7de4605a0a441fba8cb5ff75d678400d 100644
--- a/src/effects/SkBicubicImageFilter.cpp
+++ b/src/effects/SkBicubicImageFilter.cpp
@@ -226,9 +226,9 @@ void GrGLBicubicEffect::emitCode(GrGLShaderBuilder* builder,
const TextureSamplerArray& samplers) {
SkString coords;
fEffectMatrix.emitCodeMakeFSCoords2D(builder, key, &coords);
- fCoefficientsUni = builder->addUniform(GrGLShaderBuilder::kFragment_ShaderType,
+ fCoefficientsUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility,
kMat44f_GrSLType, "Coefficients");
- fImageIncrementUni = builder->addUniform(GrGLShaderBuilder::kFragment_ShaderType,
+ fImageIncrementUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility,
kVec2f_GrSLType, "ImageIncrement");
const char* imgInc = builder->getUniformCStr(fImageIncrementUni);
@@ -244,15 +244,14 @@ void GrGLBicubicEffect::emitCode(GrGLShaderBuilder* builder,
GrGLShaderVar("c2", kVec4f_GrSLType),
GrGLShaderVar("c3", kVec4f_GrSLType),
};
- builder->emitFunction(GrGLShaderBuilder::kFragment_ShaderType,
- kVec4f_GrSLType,
- "cubicBlend",
- SK_ARRAY_COUNT(gCubicBlendArgs),
- gCubicBlendArgs,
- "\tvec4 ts = vec4(1.0, t, t * t, t * t * t);\n"
- "\tvec4 c = coefficients * ts;\n"
- "\treturn c.x * c0 + c.y * c1 + c.z * c2 + c.w * c3;\n",
- &cubicBlendName);
+ builder->fsEmitFunction(kVec4f_GrSLType,
+ "cubicBlend",
+ SK_ARRAY_COUNT(gCubicBlendArgs),
+ gCubicBlendArgs,
+ "\tvec4 ts = vec4(1.0, t, t * t, t * t * t);\n"
+ "\tvec4 c = coefficients * ts;\n"
+ "\treturn c.x * c0 + c.y * c1 + c.z * c2 + c.w * c3;\n",
+ &cubicBlendName);
builder->fsCodeAppendf("\tvec2 coord = %s - %s * vec2(0.5, 0.5);\n", coords.c_str(), imgInc);
builder->fsCodeAppendf("\tvec2 f = fract(coord / %s);\n", imgInc);
for (int y = 0; y < 4; ++y) {
@@ -260,9 +259,7 @@ void GrGLBicubicEffect::emitCode(GrGLShaderBuilder* builder,
SkString coord;
coord.printf("coord + %s * vec2(%d, %d)", imgInc, x - 1, y - 1);
builder->fsCodeAppendf("\tvec4 s%d%d = ", x, y);
- builder->appendTextureLookup(GrGLShaderBuilder::kFragment_ShaderType,
- samplers[0],
- coord.c_str());
+ builder->fsAppendTextureLookup(samplers[0], coord.c_str());
builder->fsCodeAppend(";\n");
}
builder->fsCodeAppendf("\tvec4 s%d = %s(%s, f.x, s0%d, s1%d, s2%d, s3%d);\n", y, cubicBlendName.c_str(), coeff, y, y, y, y);
« no previous file with comments | « src/effects/SkArithmeticMode.cpp ('k') | src/effects/SkColorMatrixFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698