Exemplo n.º 1
0
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());
}
Exemplo n.º 2
0
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);
}
Exemplo n.º 3
0
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());
}