Home
last modified time | relevance | path

Searched refs:fragBuilder (Results 1 – 25 of 54) sorted by relevance

123

/external/skia/src/gpu/effects/
DGrDistanceFieldGeoProc.cpp37 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local
38 SkAssertResult(fragBuilder->enableFeature( in onEmitCode()
98 fragBuilder->codeAppend(GrGLSLShaderVar::PrecisionString(args.fGLSLCaps, in onEmitCode()
100 fragBuilder->codeAppendf("vec2 uv = %s;\n", uv.fsIn()); in onEmitCode()
102 fragBuilder->codeAppend("\tfloat texColor = "); in onEmitCode()
103 fragBuilder->appendTextureLookup(args.fSamplers[0], in onEmitCode()
106 fragBuilder->codeAppend(".r;\n"); in onEmitCode()
107 fragBuilder->codeAppend("\tfloat distance = " in onEmitCode()
111 fragBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName); in onEmitCode()
114 fragBuilder->codeAppend("float afwidth;"); in onEmitCode()
[all …]
DGrBezierEffect.cpp90 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local
93 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform); in onEmitCode()
135 fragBuilder->declAppend(edgeAlpha); in onEmitCode()
136 fragBuilder->declAppend(dklmdx); in onEmitCode()
137 fragBuilder->declAppend(dklmdy); in onEmitCode()
138 fragBuilder->declAppend(dfdx); in onEmitCode()
139 fragBuilder->declAppend(dfdy); in onEmitCode()
140 fragBuilder->declAppend(gF); in onEmitCode()
141 fragBuilder->declAppend(gFM); in onEmitCode()
142 fragBuilder->declAppend(func); in onEmitCode()
[all …]
DGrRRectEffect.cpp178 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
179 const char* fragmentPos = fragBuilder->fragmentPosition(); in emitCode()
197 fragBuilder->codeAppendf("vec2 dxy0 = %s.xy - %s.xy;", rectName, fragmentPos); in emitCode()
198 fragBuilder->codeAppendf("vec2 dxy1 = %s.xy - %s.zw;", fragmentPos, rectName); in emitCode()
199 fragBuilder->codeAppend("vec2 dxy = max(max(dxy0, dxy1), 0.0);"); in emitCode()
200 fragBuilder->codeAppendf("float alpha = %s;", clampedCircleDistance.c_str()); in emitCode()
203 fragBuilder->codeAppendf("vec2 dxy = max(%s.xy - %s.xy, 0.0);", in emitCode()
205 fragBuilder->codeAppendf("float rightAlpha = clamp(%s.z - %s.x, 0.0, 1.0);", in emitCode()
207 fragBuilder->codeAppendf("float bottomAlpha = clamp(%s.w - %s.y, 0.0, 1.0);", in emitCode()
209 fragBuilder->codeAppendf("float alpha = bottomAlpha * rightAlpha * %s;", in emitCode()
[all …]
DGrConvexPolyEffect.cpp113 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
114 const char* fragmentPos = fragBuilder->fragmentPosition(); in emitCode()
118 fragBuilder->codeAppend("\t\tfloat xSub, ySub;\n"); in emitCode()
119 fragBuilder->codeAppendf("\t\txSub = min(%s.x - %s.x, 0.0);\n", fragmentPos, rectName); in emitCode()
120 fragBuilder->codeAppendf("\t\txSub += min(%s.z - %s.x, 0.0);\n", rectName, fragmentPos); in emitCode()
121 fragBuilder->codeAppendf("\t\tySub = min(%s.y - %s.y, 0.0);\n", fragmentPos, rectName); in emitCode()
122 fragBuilder->codeAppendf("\t\tySub += min(%s.w - %s.y, 0.0);\n", rectName, fragmentPos); in emitCode()
125fragBuilder->codeAppendf("\t\tfloat alpha = (1.0 + max(xSub, -1.0)) * (1.0 + max(ySub, -1.0));\n"); in emitCode()
127 fragBuilder->codeAppendf("\t\tfloat alpha = 1.0;\n"); in emitCode()
128fragBuilder->codeAppendf("\t\talpha *= (%s.x - %s.x) > -0.5 ? 1.0 : 0.0;\n", fragmentPos, rectName… in emitCode()
[all …]
DGrOvalEffect.cpp123 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
124 const char* fragmentPos = fragBuilder->fragmentPosition(); in emitCode()
132 fragBuilder->codeAppendf("float d = (length((%s.xy - %s.xy) * %s.w) - 1.0) * %s.z;", in emitCode()
135 fragBuilder->codeAppendf("float d = (1.0 - length((%s.xy - %s.xy) * %s.w)) * %s.z;", in emitCode()
139 fragBuilder->codeAppend("d = clamp(d, 0.0, 1.0);"); in emitCode()
141 fragBuilder->codeAppend("d = d > 0.5 ? 1.0 : 0.0;"); in emitCode()
144 fragBuilder->codeAppendf("%s = %s;", args.fOutputColor, in emitCode()
304 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
305 const char* fragmentPos = fragBuilder->fragmentPosition(); in emitCode()
308 fragBuilder->codeAppendf("vec2 d = %s.xy - %s.xy;", fragmentPos, ellipseName); in emitCode()
[all …]
DGrMatrixConvolutionEffect.cpp64 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
65 SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0); in emitCode()
66 fragBuilder->codeAppend("vec4 sum = vec4(0, 0, 0, 0);"); in emitCode()
67 fragBuilder->codeAppendf("vec2 coord = %s - %s * %s;", coords2D.c_str(), kernelOffset, imgInc); in emitCode()
68 fragBuilder->codeAppend("vec4 c;"); in emitCode()
72 GrGLSLShaderBuilder::ShaderBlock block(fragBuilder); in emitCode()
73 fragBuilder->codeAppendf("float k = %s[%d * %d + %d];", kernel, y, kWidth, x); in emitCode()
76 fDomain.sampleTexture(fragBuilder, in emitCode()
84 fragBuilder->codeAppend("c.rgb /= c.a;"); in emitCode()
85 fragBuilder->codeAppend("c.rgb = clamp(c.rgb, 0.0, 1.0);"); in emitCode()
[all …]
DGrBicubicEffect.cpp71 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
72 SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0); in emitCode()
73 fragBuilder->emitFunction(kVec4f_GrSLType, in emitCode()
81 fragBuilder->codeAppendf("\tvec2 coord = %s - %s * vec2(0.5);\n", coords2D.c_str(), imgInc); in emitCode()
86 fragBuilder->codeAppendf("\tcoord /= %s;\n", imgInc); in emitCode()
87 fragBuilder->codeAppend("\tvec2 f = fract(coord);\n"); in emitCode()
88 fragBuilder->codeAppendf("\tcoord = (coord - f + vec2(0.5)) * %s;\n", imgInc); in emitCode()
89 fragBuilder->codeAppend("\tvec4 rowColors[4];\n"); in emitCode()
96 fDomain.sampleTexture(fragBuilder, in emitCode()
104 fragBuilder->codeAppendf( in emitCode()
[all …]
DGrBitmapTextGeoProc.cpp42 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local
48 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, in onEmitCode()
67 fragBuilder->codeAppendf("%s = ", args.fOutputColor); in onEmitCode()
68 fragBuilder->appendTextureLookupAndModulate(args.fOutputColor, in onEmitCode()
72 fragBuilder->codeAppend(";"); in onEmitCode()
73 fragBuilder->codeAppendf("%s = vec4(1);", args.fOutputCoverage); in onEmitCode()
75 fragBuilder->codeAppendf("%s = ", args.fOutputCoverage); in onEmitCode()
76 fragBuilder->appendTextureLookup(args.fSamplers[0], v.fsIn(), kVec2f_GrSLType); in onEmitCode()
77 fragBuilder->codeAppend(";"); in onEmitCode()
80 fragBuilder->codeAppendf("%s.a = max(max(%s.r, %s.g), %s.b);", in onEmitCode()
DGrConvolutionEffect.cpp53 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
54 SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0); in emitCode()
56 fragBuilder->codeAppendf("%s = vec4(0, 0, 0, 0);", args.fOutputColor); in emitCode()
61 fragBuilder->codeAppendf("vec2 coord = %s - %d.0 * %s;", coords2D.c_str(), ce.radius(), imgInc); in emitCode()
76 fragBuilder->codeAppendf("if (coord.%s >= %s.x && coord.%s <= %s.y) {", in emitCode()
79 fragBuilder->codeAppendf("\t\t%s += ", args.fOutputColor); in emitCode()
80 fragBuilder->appendTextureLookup(args.fSamplers[0], "coord"); in emitCode()
81 fragBuilder->codeAppendf(" * %s;\n", kernelIndex.c_str()); in emitCode()
83 fragBuilder->codeAppend("}"); in emitCode()
85 fragBuilder->codeAppendf("\t\tcoord += %s;\n", imgInc); in emitCode()
[all …]
DGrConfigConversionEffect.cpp29 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
31 fragBuilder->codeAppendf("%s;", tmpDecl.c_str()); in emitCode()
33 fragBuilder->codeAppendf("%s = ", tmpVar.c_str()); in emitCode()
34 fragBuilder->appendTextureLookup(args.fSamplers[0], args.fCoords[0].c_str(), in emitCode()
36 fragBuilder->codeAppend(";"); in emitCode()
40 fragBuilder->codeAppendf("%s = %s.%s;", args.fOutputColor, tmpVar.c_str(), in emitCode()
45 fragBuilder->codeAppendf( in emitCode()
54 fragBuilder->codeAppendf( in emitCode()
60 fragBuilder->codeAppendf( in emitCode()
66 fragBuilder->codeAppendf( in emitCode()
[all …]
DGrYUVEffect.cpp102 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
108 fragBuilder->codeAppendf("%s = vec4(", args.fOutputColor); in emitCode()
109 fragBuilder->appendTextureLookup(args.fSamplers[0], args.fCoords[0].c_str(), in emitCode()
111 fragBuilder->codeAppend(".r,"); in emitCode()
112 fragBuilder->appendTextureLookup(args.fSamplers[1], args.fCoords[1].c_str(), in emitCode()
114 fragBuilder->codeAppend(".r,"); in emitCode()
115 fragBuilder->appendTextureLookup(args.fSamplers[2], args.fCoords[2].c_str(), in emitCode()
117 fragBuilder->codeAppendf(".r, 1.0) * %s;", colorSpaceMatrix); in emitCode()
228 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
241 fragBuilder->codeAppendf("%s = vec4(dot(rgbColor.rgb, %s[0].rgb) + %s[0].a," in emitCode()
[all …]
/external/skia/src/effects/
DSkPixelXorXfermode.cpp55 static void add_pixelxor_code(GrGLSLFragmentBuilder* fragBuilder, in add_pixelxor_code() argument
72 fragBuilder->emitFunction(kFloat_GrSLType, in add_pixelxor_code()
82 fragBuilder->codeAppend("float red = 0.0, green = 0.0, blue = 0.0;"); in add_pixelxor_code()
85 fragBuilder->codeAppendf("vec3 src = 255.99 * %s.rgb;", srcColor); in add_pixelxor_code()
87 fragBuilder->codeAppendf("vec3 src = vec3(255.99);"); in add_pixelxor_code()
89 fragBuilder->codeAppendf("vec3 dst = 255.99 * %s.rgb;", dstColor); in add_pixelxor_code()
90 fragBuilder->codeAppendf("vec3 op = 255.99 * %s;", opColor); in add_pixelxor_code()
92 fragBuilder->codeAppend("float modValue = 128.0;"); in add_pixelxor_code()
94 fragBuilder->codeAppend("for (int i = 0; i < 8; i++) {"); in add_pixelxor_code()
96 fragBuilder->codeAppendf("float bit = %s(src.r, dst.r, op.r, modValue);", xorFuncName.c_str()); in add_pixelxor_code()
[all …]
DSkMagnifierImageFilter.cpp132 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
133 SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0); in emitCode()
134 fragBuilder->codeAppendf("\t\tvec2 coord = %s;\n", coords2D.c_str()); in emitCode()
135 fragBuilder->codeAppendf("\t\tvec2 zoom_coord = %s + %s * %s;\n", in emitCode()
140 fragBuilder->codeAppendf("\t\tvec2 delta = (coord - %s.xy) * %s.zw;\n", bounds, bounds); in emitCode()
141 fragBuilder->codeAppendf("\t\tdelta = min(delta, vec2(1.0, 1.0) - delta);\n"); in emitCode()
142 fragBuilder->codeAppendf("\t\tdelta = delta * %s;\n", in emitCode()
145 fragBuilder->codeAppend("\t\tfloat weight = 0.0;\n"); in emitCode()
146 fragBuilder->codeAppend("\t\tif (delta.s < 2.0 && delta.t < 2.0) {\n"); in emitCode()
147 fragBuilder->codeAppend("\t\t\tdelta = vec2(2.0, 2.0) - delta;\n"); in emitCode()
[all …]
DSkAlphaThresholdFilter.cpp175 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
176 SkString coords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 0); in emitCode()
177 SkString maskCoords2D = fragBuilder->ensureFSCoords2D(args.fCoords, 1); in emitCode()
179 fragBuilder->codeAppendf("\t\tvec2 coord = %s;\n", coords2D.c_str()); in emitCode()
180 fragBuilder->codeAppendf("\t\tvec2 mask_coord = %s;\n", maskCoords2D.c_str()); in emitCode()
181 fragBuilder->codeAppend("\t\tvec4 input_color = "); in emitCode()
182 fragBuilder->appendTextureLookup(args.fSamplers[0], "coord"); in emitCode()
183 fragBuilder->codeAppend(";\n"); in emitCode()
184 fragBuilder->codeAppend("\t\tvec4 mask_color = "); in emitCode()
185 fragBuilder->appendTextureLookup(args.fSamplers[1], "mask_coord"); in emitCode()
[all …]
DSkBlurMaskFilter.cpp693 void OutputRectBlurProfileLookup(GrGLSLFPFragmentBuilder* fragBuilder, in OutputRectBlurProfileLookup() argument
699 fragBuilder->codeAppendf("float %s;", output); in OutputRectBlurProfileLookup()
700 fragBuilder->codeAppendf("{"); in OutputRectBlurProfileLookup()
701 fragBuilder->codeAppendf("float coord = ((abs(%s - 0.5 * %s) - 0.5 * %s)) / %s;", in OutputRectBlurProfileLookup()
703 fragBuilder->codeAppendf("%s = ", output); in OutputRectBlurProfileLookup()
704 fragBuilder->appendTextureLookup(sampler, "vec2(coord,0.5)"); in OutputRectBlurProfileLookup()
705 fragBuilder->codeAppend(".a;"); in OutputRectBlurProfileLookup()
706 fragBuilder->codeAppendf("}"); in OutputRectBlurProfileLookup()
738 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
739 const char *fragmentPos = fragBuilder->fragmentPosition(); in emitCode()
[all …]
DSkArithmeticMode_gpu.cpp22 static void add_arithmetic_code(GrGLSLFragmentBuilder* fragBuilder, in add_arithmetic_code() argument
30 fragBuilder->codeAppend("const vec4 src = vec4(1);"); in add_arithmetic_code()
32 fragBuilder->codeAppendf("vec4 src = %s;", srcColor); in add_arithmetic_code()
35 fragBuilder->codeAppendf("vec4 dst = %s;", dstColor); in add_arithmetic_code()
36 fragBuilder->codeAppendf("%s = %s.x * src * dst + %s.y * src + %s.z * dst + %s.w;", in add_arithmetic_code()
38 fragBuilder->codeAppendf("%s = clamp(%s, 0.0, 1.0);\n", outputColor, outputColor); in add_arithmetic_code()
40 fragBuilder->codeAppendf("%s.rgb = min(%s.rgb, %s.a);", in add_arithmetic_code()
50 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
59 add_arithmetic_code(fragBuilder, in emitCode()
197 void emitBlendCodeForDstRead(GrGLSLXPFragmentBuilder* fragBuilder, in emitBlendCodeForDstRead() argument
[all …]
DGrCircleBlurFragmentProcessor.cpp49 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
50 const char *fragmentPos = fragBuilder->fragmentPosition(); in emitCode()
53 fragBuilder->codeAppendf("vec4 src=%s;", args.fInputColor); in emitCode()
55 fragBuilder->codeAppendf("vec4 src=vec4(1);"); in emitCode()
60 fragBuilder->codeAppendf("vec2 vec = vec2( (%s.x - %s.x) * %s.w , (%s.y - %s.y) * %s.w );", in emitCode()
63 fragBuilder->codeAppendf("float dist = length(vec) + ( 0.5 - %s.z ) * %s.w;", in emitCode()
66 fragBuilder->codeAppendf("float intensity = "); in emitCode()
67 fragBuilder->appendTextureLookup(args.fSamplers[0], "vec2(dist, 0.5)"); in emitCode()
68 fragBuilder->codeAppend(".a;"); in emitCode()
70 fragBuilder->codeAppendf("%s = src * intensity;\n", args.fOutputColor ); in emitCode()
DSkTableColorFilter.cpp418 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
422 fragBuilder->codeAppendf("\t\tvec4 coord = vec4(%f, %f, %f, %f);\n", in emitCode()
426 fragBuilder->codeAppendf("\t\tfloat nonZeroAlpha = max(%s.a, .0001);\n", args.fInputColor); in emitCode()
427 fragBuilder->codeAppendf("\t\tvec4 coord = vec4(%s.rgb / nonZeroAlpha, nonZeroAlpha);\n", in emitCode()
429 fragBuilder->codeAppendf("\t\tcoord = coord * %f + vec4(%f, %f, %f, %f);\n", in emitCode()
437 fragBuilder->codeAppendf("\t\t%s.a = ", args.fOutputColor); in emitCode()
439 fragBuilder->appendTextureLookup(args.fSamplers[0], coord.c_str()); in emitCode()
440 fragBuilder->codeAppend(".a;\n"); in emitCode()
442 fragBuilder->codeAppendf("\t\t%s.r = ", args.fOutputColor); in emitCode()
444 fragBuilder->appendTextureLookup(args.fSamplers[0], coord.c_str()); in emitCode()
[all …]
DSkAvoidXfermode.cpp246 static void add_avoid_code(GrGLSLFragmentBuilder* fragBuilder, in add_avoid_code() argument
253 fragBuilder->codeAppendf("vec3 temp = %s.rgb - %s.rgb;", dstColor, kColorAndTolUni); in add_avoid_code()
254 fragBuilder->codeAppendf("float dist = max(max(abs(temp.r), abs(temp.g)), abs(temp.b));"); in add_avoid_code()
257 fragBuilder->codeAppendf("dist = 1.0 - dist;"); in add_avoid_code()
261 fragBuilder->codeAppendf("dist = dist * %s.a - (%s.a - 1.0);", in add_avoid_code()
264 fragBuilder->codeAppendf("vec4 %s = vec4(dist);", kCoverageName); in add_avoid_code()
266 fragBuilder->codeAppendf("%s *= %s;", kCoverageName, srcCoverage); in add_avoid_code()
275 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
288 add_avoid_code(fragBuilder, in emitCode()
294 fragBuilder->codeAppendf("if (%s.r < 0.0039) { %s = %s; } else {", in emitCode()
[all …]
DSkColorCubeFilter.cpp259 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
262 fragBuilder->codeAppendf("\tfloat %s = max(%s.a, 0.00001);\n", nonZeroAlpha, args.fInputColor); in emitCode()
263 fragBuilder->codeAppendf("\tvec4 %s = vec4(%s.rgb / %s, %s);\n", in emitCode()
267 fragBuilder->codeAppendf( in emitCode()
273 fragBuilder->codeAppendf("vec2 %s = vec2(%s.r, (floor(%s.b) + %s.g) * %s);\n", in emitCode()
275 fragBuilder->codeAppendf("vec2 %s = vec2(%s.r, (ceil(%s.b) + %s.g) * %s);\n", in emitCode()
279 fragBuilder->codeAppendf("%s = vec4(mix(", args.fOutputColor); in emitCode()
280 fragBuilder->appendTextureLookup(args.fSamplers[0], cCoords1); in emitCode()
281 fragBuilder->codeAppend(".bgr, "); in emitCode()
282 fragBuilder->appendTextureLookup(args.fSamplers[0], cCoords2); in emitCode()
[all …]
DSkPerlinNoiseShader.cpp597 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
599 SkString vCoords = fragBuilder->ensureFSCoords2D(args.fCoords, 0); in emitCode()
681 fragBuilder->appendTextureLookup(&noiseCode, args.fSamplers[0], xCoords.c_str(), in emitCode()
692 fragBuilder->appendTextureLookup(&noiseCode, args.fSamplers[0], xCoords.c_str(), in emitCode()
717 fragBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(), in emitCode()
729 fragBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(), in emitCode()
745 fragBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(), in emitCode()
757 fragBuilder->appendTextureLookup(&noiseCode, args.fSamplers[1], latticeCoords.c_str(), in emitCode()
770 fragBuilder->emitFunction(kFloat_GrSLType, in emitCode()
774 fragBuilder->emitFunction(kFloat_GrSLType, in emitCode()
[all …]
/external/skia/src/gpu/glsl/
DGrGLSLXferProcessor.cpp21 GrGLSLXPFragmentBuilder* fragBuilder = args.fXPFragBuilder; in emitCode() local
23 const char* dstColor = fragBuilder->dstColor(); in emitCode()
31 fragBuilder->codeAppendf("if (all(lessThanEqual(%s, vec4(0)))) {" in emitCode()
49 const char* fragPos = fragBuilder->fragmentPosition(); in emitCode()
51 fragBuilder->codeAppend("// Read color from copy of the destination.\n"); in emitCode()
52 fragBuilder->codeAppendf("vec2 _dstTexCoord = (%s.xy - %s) * %s;", in emitCode()
56 fragBuilder->codeAppend("_dstTexCoord.y = 1.0 - _dstTexCoord.y;"); in emitCode()
59 fragBuilder->codeAppendf("vec4 %s = ", dstColor); in emitCode()
60 fragBuilder->appendTextureLookup(args.fSamplers[0], "_dstTexCoord", kVec2f_GrSLType); in emitCode()
61 fragBuilder->codeAppend(";"); in emitCode()
[all …]
DGrGLSLFragmentProcessor.cpp31 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitChild() local
32 outputColor->append(fragBuilder->getMangleString()); in emitChild()
33 fragBuilder->codeAppendf("vec4 %s;", outputColor->c_str()); in emitChild()
39 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in internalEmitChild() local
41 fragBuilder->onBeforeChildProcEmitCode(); // call first so mangleString is updated in internalEmitChild()
93 fragBuilder->codeAppend("{\n"); in internalEmitChild()
94 fragBuilder->codeAppendf("// Child Index %d (mangle: %s): %s\n", childIndex, in internalEmitChild()
95 fragBuilder->getMangleString().c_str(), childProc.name()); in internalEmitChild()
96 EmitArgs childArgs(fragBuilder, in internalEmitChild()
105 fragBuilder->codeAppend("}\n"); in internalEmitChild()
[all …]
/external/skia/tools/debugger/
DSkOverdrawMode.cpp67 static void add_overdraw_code(GrGLSLFragmentBuilder* fragBuilder, in add_overdraw_code() argument
80 fragBuilder->emitFunction(kVec4f_GrSLType, in add_overdraw_code()
96 fragBuilder->codeAppend("int nextIdx;"); in add_overdraw_code()
97 fragBuilder->codeAppendf("vec4 dst = %s;", dstColor); in add_overdraw_code()
98 fragBuilder->codeAppend("if (dst.r < 0.25) { nextIdx = 1; }"); in add_overdraw_code()
100 fragBuilder->codeAppend("else if (dst.g < 0.0977) { nextIdx = 10; }"); in add_overdraw_code()
101 fragBuilder->codeAppend("else if (dst.b > 0.08) { nextIdx = 8 - int(6.0 * dst.b + 0.5); }"); in add_overdraw_code()
102 fragBuilder->codeAppend("else { nextIdx = 11 - int(5.7 * dst.g + 0.5); }"); in add_overdraw_code()
103 fragBuilder->codeAppendf("%s = %s(float(nextIdx));", outputColor, colorTableFuncName.c_str()); in add_overdraw_code()
109 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
[all …]
/external/skia/src/effects/gradients/
DSkTwoPointConicalGradient_gpu.cpp248 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
250 fragBuilder->codeAppendf("\tvec3 interpolants = vec3(%s.xy / %s.z, %s.x / %s.z);\n", in emitCode()
262 fragBuilder->codeAppendf("\t%s = vec4(0.0,0.0,0.0,0.0);\n", args.fOutputColor); in emitCode()
265 fragBuilder->codeAppendf("\tfloat %s = dot(%s, %s) - %s;\n", in emitCode()
269 fragBuilder->codeAppendf("\tfloat %s = -(%s / %s);\n", tName.c_str(), in emitCode()
273 fragBuilder->codeAppendf("\tif (%s * %s + %s > 0.0) {\n", tName.c_str(), in emitCode()
275 fragBuilder->codeAppend("\t"); in emitCode()
276 this->emitColor(fragBuilder, in emitCode()
284 fragBuilder->codeAppend("\t}\n"); in emitCode()
524 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
[all …]

123