void GrGLShaderBuilder::emitCustomTextureLookup(const GrTextureAccess& textureAccess, const char* samplerName, const char* coordName, GrSLType varyingType) { GrAssert(samplerName && coordName); SkString swizzle = build_swizzle_string(textureAccess, fContext.caps()); fFSCode.appendf("%s( %s, %s)%s;\n", sample_function_name(varyingType), samplerName, coordName, swizzle.c_str()); }
void GrGLShaderBuilder::appendTextureLookup(SkString* out, const char* samplerName, const char* coordName, GrSLType varyingType) const { if (NULL == coordName) { coordName = fDefaultTexCoordsName.c_str(); varyingType = kVec2f_GrSLType; } out->appendf("%s(%s, %s)", sample_function_name(varyingType), samplerName, coordName); }
void GrGLShaderBuilder::appendTextureLookup(SkString* out, const GrGLShaderBuilder::TextureSampler& sampler, const char* coordName, GrSLType varyingType) const { GrAssert(NULL != sampler.textureAccess()); GrAssert(NULL != coordName); out->appendf("%s(%s, %s)", sample_function_name(varyingType), this->getUniformCStr(sampler.fSamplerUniform), coordName); append_swizzle(out, *sampler.textureAccess(), fContext.caps()); }