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

Unified Diff: src/gpu/glsl/GrGLSLShaderBuilder.cpp

Issue 1885863004: Refactor how we store and use samplers in Ganesh (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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
Index: src/gpu/glsl/GrGLSLShaderBuilder.cpp
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.cpp b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
index 1031f84460acf3089afac81ee8ffd5c4f93c5005..b866fbce2a3b941c7272c1dd3941d7121aaf9558 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
@@ -68,28 +68,28 @@ void GrGLSLShaderBuilder::appendTextureLookup(SkString* out,
GrSLType varyingType) const {
const GrGLSLCaps* glslCaps = fProgramBuilder->glslCaps();
GrGLSLUniformHandler* uniformHandler = fProgramBuilder->uniformHandler();
- GrSLType samplerType = uniformHandler->getUniformVariable(sampler.fSamplerUniform).getType();
+ GrSLType samplerType = sampler.type();
if (samplerType == kSampler2DRect_GrSLType) {
if (varyingType == kVec2f_GrSLType) {
out->appendf("%s(%s, textureSize(%s) * %s)",
GrGLSLTexture2DFunctionName(varyingType, samplerType,
glslCaps->generation()),
- uniformHandler->getUniformCStr(sampler.fSamplerUniform),
- uniformHandler->getUniformCStr(sampler.fSamplerUniform),
+ sampler.getSamplerFunctionName(),
+ sampler.getSamplerFunctionName(),
coordName);
} else {
out->appendf("%s(%s, vec3(textureSize(%s) * %s.xy, %s.z))",
GrGLSLTexture2DFunctionName(varyingType, samplerType,
glslCaps->generation()),
- uniformHandler->getUniformCStr(sampler.fSamplerUniform),
- uniformHandler->getUniformCStr(sampler.fSamplerUniform),
+ sampler.getSamplerFunctionName(),
+ sampler.getSamplerFunctionName(),
coordName,
coordName);
}
} else {
out->appendf("%s(%s, %s)",
GrGLSLTexture2DFunctionName(varyingType, samplerType, glslCaps->generation()),
- uniformHandler->getUniformCStr(sampler.fSamplerUniform),
+ sampler.getSamplerFunctionName(),
coordName);
}

Powered by Google App Engine
This is Rietveld 408576698