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

Unified Diff: src/gpu/effects/GrTextureDomain.cpp

Issue 1453623003: Move glsl onto EmitArgs struct for emitCode (Closed) Base URL: https://skia.googlesource.com/skia.git@moveShaders
Patch Set: nit Created 5 years, 1 month 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/gpu/effects/GrTextureDomain.h ('k') | src/gpu/gl/builders/GrGLProgramBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrTextureDomain.cpp
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index cc2f80830617b4e30ade39c8a31ef90e6d4e7071..c0902c617609f6aa0ba9c5331be45536c061cdc1 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -42,6 +42,7 @@ GrTextureDomain::GrTextureDomain(const SkRect& domain, Mode mode, int index)
//////////////////////////////////////////////////////////////////////////////
void GrTextureDomain::GLDomain::sampleTexture(GrGLSLShaderBuilder* builder,
+ const GrGLSLCaps* glslCaps,
const GrTextureDomain& textureDomain,
const char* outColor,
const SkString& inCoords,
@@ -88,7 +89,7 @@ void GrTextureDomain::GLDomain::sampleTexture(GrGLSLShaderBuilder* builder,
GrGLSLShaderBuilder::ShaderBlock block(builder);
const char* domain = fDomainName.c_str();
- if (!program->glslCaps()->canUseAnyFunctionInShader()) {
+ if (!glslCaps->canUseAnyFunctionInShader()) {
// On the NexusS and GalaxyNexus, the other path (with the 'any'
// call) causes the compilation error "Calls to any function that
// may require a gradient calculation inside a conditional block
@@ -101,10 +102,10 @@ void GrTextureDomain::GLDomain::sampleTexture(GrGLSLShaderBuilder* builder,
inCoords.c_str());
builder->codeAppend(";");
- builder->codeAppend(GrGLSLShaderVar::PrecisionString(program->glslCaps(),
+ builder->codeAppend(GrGLSLShaderVar::PrecisionString(glslCaps,
kHigh_GrSLPrecision));
builder->codeAppendf("float x = (%s).x;", inCoords.c_str());
- builder->codeAppend(GrGLSLShaderVar::PrecisionString(program->glslCaps(),
+ builder->codeAppend(GrGLSLShaderVar::PrecisionString(glslCaps,
kHigh_GrSLPrecision));
builder->codeAppendf("float y = (%s).y;", inCoords.c_str());
@@ -197,7 +198,12 @@ void GrGLTextureDomainEffect::emitCode(EmitArgs& args) {
GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0);
- fGLDomain.sampleTexture(fragBuilder, domain, args.fOutputColor, coords2D, args.fSamplers[0],
+ fGLDomain.sampleTexture(fragBuilder,
+ args.fGLSLCaps,
+ domain,
+ args.fOutputColor,
+ coords2D,
+ args.fSamplers[0],
args.fInputColor);
}
« no previous file with comments | « src/gpu/effects/GrTextureDomain.h ('k') | src/gpu/gl/builders/GrGLProgramBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698