Lines Matching full:builder
42 void GrTextureDomain::GLDomain::sampleTexture(GrGLShaderBuilder* builder,
52 builder->fsCodeAppendf("\t%s = ", outColor);
53 builder->fsAppendTextureLookupAndModulate(inModulateColor, sampler,
55 builder->fsCodeAppend(";\n");
65 fDomainUni = builder->addUniform(GrGLShaderBuilder::kFragment_Visibility,
74 builder->fsCodeAppendf("\t%s = ", outColor);
75 builder->fsAppendTextureLookupAndModulate(inModulateColor, sampler, clampedCoords.c_str());
76 builder->fsCodeAppend(";\n");
80 GrGLShaderBuilder::FSBlock block(builder);
83 if (kImagination_GrGLVendor == builder->ctxInfo().vendor()) {
90 builder->fsCodeAppend("\tvec4 outside = vec4(0.0, 0.0, 0.0, 0.0);\n");
91 builder->fsCodeAppend("\tvec4 inside = ");
92 builder->fsAppendTextureLookupAndModulate(inModulateColor, sampler, inCoords.c_str());
93 builder->fsCodeAppend(";\n");
95 builder->fsCodeAppendf("\tfloat x = abs(2.0*(%s.x - %s.x)/(%s.z - %s.x) - 1.0);\n",
97 builder->fsCodeAppendf("\tfloat y = abs(2.0*(%s.y - %s.y)/(%s.w - %s.y) - 1.0);\n",
99 builder->fsCodeAppend("\tfloat blend = step(1.0, max(x, y));\n");
100 builder->fsCodeAppendf("\t%s = mix(inside, outside, blend);\n", outColor);
102 builder->fsCodeAppend("\tbvec4 outside;\n");
103 builder->fsCodeAppendf("\toutside.xy = lessThan(%s, %s.xy);\n", inCoords.c_str(),
105 builder->fsCodeAppendf("\toutside.zw = greaterThan(%s, %s.zw);\n", inCoords.c_str(),
107 builder->fsCodeAppendf("\t%s = any(outside) ? vec4(0.0, 0.0, 0.0, 0.0) : ", outColor);
108 builder->fsAppendTextureLookupAndModulate(inModulateColor, sampler, inCoords.c_str());
109 builder->fsCodeAppend(";\n");
169 void GrGLTextureDomainEffect::emitCode(GrGLShaderBuilder* builder,
179 SkString coords2D = builder->ensureFSCoords2D(coords, 0);
180 fGLDomain.sampleTexture(builder, domain, outputColor, coords2D, samplers[0], inputColor);