Home
last modified time | relevance | path

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

123456

/external/skqp/src/effects/
DSkHighContrastFilter.cpp263 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
265 fragBuilder->codeAppendf("half4 color = %s;", args.fInputColor); in emitCode()
268 fragBuilder->codeAppendf("half nonZeroAlpha = max(color.a, 0.00001);"); in emitCode()
269 fragBuilder->codeAppendf("color = half4(color.rgb / nonZeroAlpha, nonZeroAlpha);"); in emitCode()
272 fragBuilder->codeAppend("color.rgb = color.rgb * color.rgb;"); in emitCode()
277 fragBuilder->codeAppendf("half luma = dot(color, half4(%f, %f, %f, 0));", in emitCode()
279 fragBuilder->codeAppendf("color = half4(luma, luma, luma, 0);"); in emitCode()
283 fragBuilder->codeAppendf("color = half4(1, 1, 1, 1) - color;"); in emitCode()
288 fragBuilder->codeAppendf("half fmax = max(color.r, max(color.g, color.b));"); in emitCode()
289 fragBuilder->codeAppendf("half fmin = min(color.r, min(color.g, color.b));"); in emitCode()
[all …]
DSkRRectsGaussianEdgeMaskFilter.cpp236 GrGLSLFPFragmentBuilder* fragBuilder, in emitModeCode() argument
246 fragBuilder->codeAppendf("half2 delta = abs(sk_FragCoord.xy - %s.%s);", in emitModeCode()
254 fragBuilder->codeAppendf("half scaledDist = length(delta/%s);", radName); in emitModeCode()
255 fragBuilder->codeAppendf("%s = clamp((%s.%c/%s - scaledDist), 0.0, 1.0);", in emitModeCode()
259 fragBuilder->codeAppendf( in emitModeCode()
264 fragBuilder->codeAppendf("%s = clamp(1.0 - length(rectDist), 0.0, 1.0);", in emitModeCode()
278 fragBuilder->codeAppendf("half xDist = (%s.%c - delta.x) / %s;", in emitModeCode()
280 fragBuilder->codeAppendf("half yDist = (%s.%c - delta.y) / %s;", in emitModeCode()
282 fragBuilder->codeAppend("half rectDist = clamp(min(xDist, yDist), 0.0, 1.0);"); in emitModeCode()
291 fragBuilder->codeAppendf("half insetDist = min(max(%s, %s.%c)," in emitModeCode()
[all …]
/external/skia/src/effects/
DSkHighContrastFilter.cpp263 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
265 fragBuilder->codeAppendf("half4 color = %s;", args.fInputColor); in emitCode()
268 fragBuilder->codeAppendf("half nonZeroAlpha = max(color.a, 0.00001);"); in emitCode()
269 fragBuilder->codeAppendf("color = half4(color.rgb / nonZeroAlpha, nonZeroAlpha);"); in emitCode()
272 fragBuilder->codeAppend("color.rgb = color.rgb * color.rgb;"); in emitCode()
277 fragBuilder->codeAppendf("half luma = dot(color, half4(%f, %f, %f, 0));", in emitCode()
279 fragBuilder->codeAppendf("color = half4(luma, luma, luma, 0);"); in emitCode()
283 fragBuilder->codeAppendf("color = half4(1, 1, 1, 1) - color;"); in emitCode()
288 fragBuilder->codeAppendf("half fmax = max(color.r, max(color.g, color.b));"); in emitCode()
289 fragBuilder->codeAppendf("half fmin = min(color.r, min(color.g, color.b));"); in emitCode()
[all …]
DSkRRectsGaussianEdgeMaskFilter.cpp236 GrGLSLFPFragmentBuilder* fragBuilder, in emitModeCode() argument
246 fragBuilder->codeAppendf("half2 delta = abs(sk_FragCoord.xy - %s.%s);", in emitModeCode()
254 fragBuilder->codeAppendf("half scaledDist = length(delta/%s);", radName); in emitModeCode()
255 fragBuilder->codeAppendf("%s = clamp((%s.%c/%s - scaledDist), 0.0, 1.0);", in emitModeCode()
259 fragBuilder->codeAppendf( in emitModeCode()
264 fragBuilder->codeAppendf("%s = clamp(1.0 - length(rectDist), 0.0, 1.0);", in emitModeCode()
278 fragBuilder->codeAppendf("half xDist = (%s.%c - delta.x) / %s;", in emitModeCode()
280 fragBuilder->codeAppendf("half yDist = (%s.%c - delta.y) / %s;", in emitModeCode()
282 fragBuilder->codeAppend("half rectDist = clamp(min(xDist, yDist), 0.0, 1.0);"); in emitModeCode()
291 fragBuilder->codeAppendf("half insetDist = min(max(%s, %s.%c)," in emitModeCode()
[all …]
/external/skia/src/gpu/effects/
DGrDistanceFieldGeoProc.cpp30 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local
84 fragBuilder->codeAppendf("float2 uv = %s;\n", uv.fsIn()); in onEmitCode()
85 fragBuilder->codeAppend("half4 texColor;"); in onEmitCode()
89 fragBuilder->codeAppend("half distance = " in onEmitCode()
93 fragBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName); in onEmitCode()
96 fragBuilder->codeAppend("half afwidth;"); in onEmitCode()
104 fragBuilder->codeAppendf("afwidth = abs(" SK_DistanceFieldAAFactor "*dFdx(%s.x));", in onEmitCode()
108 fragBuilder->codeAppendf("afwidth = abs(" SK_DistanceFieldAAFactor "*dFdy(%s.y));", in onEmitCode()
119 fragBuilder->codeAppendf("half st_grad_len = length(dFdx(%s));", st.fsIn()); in onEmitCode()
122 fragBuilder->codeAppendf("half st_grad_len = length(dFdy(%s));", st.fsIn()); in onEmitCode()
[all …]
DGrBezierEffect.cpp84 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local
86 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform); in onEmitCode()
117 fragBuilder->declAppend(edgeAlpha); in onEmitCode()
118 fragBuilder->declAppend(dklmdx); in onEmitCode()
119 fragBuilder->declAppend(dklmdy); in onEmitCode()
120 fragBuilder->declAppend(dfdx); in onEmitCode()
121 fragBuilder->declAppend(dfdy); in onEmitCode()
122 fragBuilder->declAppend(gF); in onEmitCode()
123 fragBuilder->declAppend(gFM); in onEmitCode()
124 fragBuilder->declAppend(func); in onEmitCode()
[all …]
DGrRRectEffect.cpp175 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
193 fragBuilder->codeAppendf("float2 dxy0 = %s.xy - sk_FragCoord.xy;", rectName); in emitCode()
194 fragBuilder->codeAppendf("float2 dxy1 = sk_FragCoord.xy - %s.zw;", rectName); in emitCode()
195 fragBuilder->codeAppend("float2 dxy = max(max(dxy0, dxy1), 0.0);"); in emitCode()
196 fragBuilder->codeAppendf("half alpha = %s;", clampedCircleDistance.c_str()); in emitCode()
199 fragBuilder->codeAppendf("float2 dxy = max(%s.xy - sk_FragCoord.xy, 0.0);", in emitCode()
201 fragBuilder->codeAppendf("half rightAlpha = clamp(%s.z - sk_FragCoord.x, 0.0, 1.0);", in emitCode()
203 fragBuilder->codeAppendf("half bottomAlpha = clamp(%s.w - sk_FragCoord.y, 0.0, 1.0);", in emitCode()
205 fragBuilder->codeAppendf("half alpha = bottomAlpha * rightAlpha * %s;", in emitCode()
209 fragBuilder->codeAppendf("float2 dxy = max(float2(sk_FragCoord.x - %s.z, " in emitCode()
[all …]
DGrYUVtoRGBEffect.cpp75 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
91 SkString sk_TransformedCoords2D_0 = fragBuilder->ensureCoords2D(args.fTransformedCoords[0]); in emitCode()
92 SkString sk_TransformedCoords2D_1 = fragBuilder->ensureCoords2D(args.fTransformedCoords[1]); in emitCode()
93 SkString sk_TransformedCoords2D_2 = fragBuilder->ensureCoords2D(args.fTransformedCoords[2]); in emitCode()
94 fragBuilder->codeAppendf( in emitCode()
99 fragBuilder->getProgramBuilder()->samplerVariable(args.fTexSamplers[0]).c_str(), in emitCode()
101 fragBuilder->getProgramBuilder()->samplerSwizzle(args.fTexSamplers[0]).c_str(), in emitCode()
102 fragBuilder->getProgramBuilder()->samplerVariable(args.fTexSamplers[1]).c_str(), in emitCode()
104 fragBuilder->getProgramBuilder()->samplerSwizzle(args.fTexSamplers[1]).c_str(), in emitCode()
106 fragBuilder->getProgramBuilder()->samplerVariable(args.fTexSamplers[0]).c_str(), in emitCode()
[all …]
DGrBicubicEffect.cpp47 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
48 SkString coords2D = fragBuilder->ensureCoords2D(args.fTransformedCoords[0]); in emitCode()
68 fragBuilder->codeAppend("half4x4 kMitchellCoefficients = half4x4(" in emitCode()
73 fragBuilder->codeAppendf("float2 coord = %s - %s * float2(0.5);", coords2D.c_str(), imgInc); in emitCode()
78 fragBuilder->codeAppendf("coord /= %s;", imgInc); in emitCode()
79 fragBuilder->codeAppend("float2 f = fract(coord);"); in emitCode()
80 fragBuilder->codeAppendf("coord = (coord - f + float2(0.5)) * %s;", imgInc); in emitCode()
81fragBuilder->codeAppend("half4 wx = kMitchellCoefficients * half4(1.0, f.x, f.x * f.x, f.x * f.x *… in emitCode()
82fragBuilder->codeAppend("half4 wy = kMitchellCoefficients * half4(1.0, f.y, f.y * f.y, f.y * f.y *… in emitCode()
83 fragBuilder->codeAppend("half4 rowColors[4];"); in emitCode()
[all …]
DGrMatrixConvolutionEffect.cpp66 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
67 SkString coords2D = fragBuilder->ensureCoords2D(args.fTransformedCoords[0]); in emitCode()
68 fragBuilder->codeAppend("half4 sum = half4(0, 0, 0, 0);"); in emitCode()
69fragBuilder->codeAppendf("float2 coord = %s - %s * %s;", coords2D.c_str(), kernelOffset, imgInc); in emitCode()
70 fragBuilder->codeAppend("half4 c;"); in emitCode()
75 GrGLSLShaderBuilder::ShaderBlock block(fragBuilder); in emitCode()
78 fragBuilder->codeAppendf("half k = %s[%d]%s;", kernel, offset / 4, in emitCode()
82 fDomain.sampleTexture(fragBuilder, in emitCode()
90 fragBuilder->codeAppend("c.rgb /= c.a;"); in emitCode()
91 fragBuilder->codeAppend("c.rgb = clamp(c.rgb, 0.0, 1.0);"); in emitCode()
[all …]
DGrGaussianConvolutionFragmentProcessor.cpp59 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
60 SkString coords2D = fragBuilder->ensureCoords2D(args.fTransformedCoords[0]); in emitCode()
62 fragBuilder->codeAppendf("%s = half4(0, 0, 0, 0);", args.fOutputColor); in emitCode()
67fragBuilder->codeAppendf("float2 coord = %s - %d.0 * %s;", coords2D.c_str(), ce.radius(), imgInc); in emitCode()
68 fragBuilder->codeAppend("float2 coordSampled = half2(0, 0);"); in emitCode()
79 fragBuilder->codeAppend("coordSampled = coord;"); in emitCode()
89 fragBuilder->codeAppendf("coordSampled.%s = clamp(coord.%s, %s.x, %s.y);\n", in emitCode()
94 fragBuilder->codeAppendf("coordSampled.%s = " in emitCode()
100 fragBuilder->codeAppendf("if (coord.%s >= %s.x && coord.%s <= %s.y) {", in emitCode()
109 fragBuilder->codeAppendf("%s += ", args.fOutputColor); in emitCode()
[all …]
DGrRectBlurEffect.cpp23 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
49 fragBuilder->codeAppendf( in emitCode()
66 fragBuilder->getProgramBuilder()->samplerVariable(args.fTexSamplers[0]).c_str(), in emitCode()
67 fragBuilder->getProgramBuilder()->samplerSwizzle(args.fTexSamplers[0]).c_str()); in emitCode()
68 fragBuilder->codeAppendf( in emitCode()
77 fragBuilder->getProgramBuilder()->samplerVariable(args.fTexSamplers[0]).c_str(), in emitCode()
78 fragBuilder->getProgramBuilder()->samplerSwizzle(args.fTexSamplers[0]).c_str(), in emitCode()
88 fragBuilder->codeAppendf( in emitCode()
97 fragBuilder->getProgramBuilder()->samplerVariable(args.fTexSamplers[0]).c_str(), in emitCode()
98 fragBuilder->getProgramBuilder()->samplerSwizzle(args.fTexSamplers[0]).c_str(), in emitCode()
[all …]
/external/skqp/src/gpu/effects/
DGrDistanceFieldGeoProc.cpp30 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local
84 fragBuilder->codeAppendf("float2 uv = %s;\n", uv.fsIn()); in onEmitCode()
85 fragBuilder->codeAppend("half4 texColor;"); in onEmitCode()
89 fragBuilder->codeAppend("half distance = " in onEmitCode()
93 fragBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName); in onEmitCode()
96 fragBuilder->codeAppend("half afwidth;"); in onEmitCode()
104 fragBuilder->codeAppendf("afwidth = abs(" SK_DistanceFieldAAFactor "*dFdx(%s.x));", in onEmitCode()
108 fragBuilder->codeAppendf("afwidth = abs(" SK_DistanceFieldAAFactor "*dFdy(%s.y));", in onEmitCode()
119 fragBuilder->codeAppendf("half st_grad_len = length(dFdx(%s));", st.fsIn()); in onEmitCode()
122 fragBuilder->codeAppendf("half st_grad_len = length(dFdy(%s));", st.fsIn()); in onEmitCode()
[all …]
DGrBezierEffect.cpp84 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder; in onEmitCode() local
86 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform); in onEmitCode()
117 fragBuilder->declAppend(edgeAlpha); in onEmitCode()
118 fragBuilder->declAppend(dklmdx); in onEmitCode()
119 fragBuilder->declAppend(dklmdy); in onEmitCode()
120 fragBuilder->declAppend(dfdx); in onEmitCode()
121 fragBuilder->declAppend(dfdy); in onEmitCode()
122 fragBuilder->declAppend(gF); in onEmitCode()
123 fragBuilder->declAppend(gFM); in onEmitCode()
124 fragBuilder->declAppend(func); in onEmitCode()
[all …]
DGrRRectEffect.cpp175 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
193 fragBuilder->codeAppendf("float2 dxy0 = %s.xy - sk_FragCoord.xy;", rectName); in emitCode()
194 fragBuilder->codeAppendf("float2 dxy1 = sk_FragCoord.xy - %s.zw;", rectName); in emitCode()
195 fragBuilder->codeAppend("float2 dxy = max(max(dxy0, dxy1), 0.0);"); in emitCode()
196 fragBuilder->codeAppendf("half alpha = %s;", clampedCircleDistance.c_str()); in emitCode()
199 fragBuilder->codeAppendf("float2 dxy = max(%s.xy - sk_FragCoord.xy, 0.0);", in emitCode()
201 fragBuilder->codeAppendf("half rightAlpha = clamp(%s.z - sk_FragCoord.x, 0.0, 1.0);", in emitCode()
203 fragBuilder->codeAppendf("half bottomAlpha = clamp(%s.w - sk_FragCoord.y, 0.0, 1.0);", in emitCode()
205 fragBuilder->codeAppendf("half alpha = bottomAlpha * rightAlpha * %s;", in emitCode()
209 fragBuilder->codeAppendf("float2 dxy = max(float2(sk_FragCoord.x - %s.z, " in emitCode()
[all …]
DGrYUVtoRGBEffect.cpp75 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
91 SkString sk_TransformedCoords2D_0 = fragBuilder->ensureCoords2D(args.fTransformedCoords[0]); in emitCode()
92 SkString sk_TransformedCoords2D_1 = fragBuilder->ensureCoords2D(args.fTransformedCoords[1]); in emitCode()
93 SkString sk_TransformedCoords2D_2 = fragBuilder->ensureCoords2D(args.fTransformedCoords[2]); in emitCode()
94 fragBuilder->codeAppendf( in emitCode()
99 fragBuilder->getProgramBuilder()->samplerVariable(args.fTexSamplers[0]).c_str(), in emitCode()
101 fragBuilder->getProgramBuilder()->samplerSwizzle(args.fTexSamplers[0]).c_str(), in emitCode()
102 fragBuilder->getProgramBuilder()->samplerVariable(args.fTexSamplers[1]).c_str(), in emitCode()
104 fragBuilder->getProgramBuilder()->samplerSwizzle(args.fTexSamplers[1]).c_str(), in emitCode()
106 fragBuilder->getProgramBuilder()->samplerVariable(args.fTexSamplers[0]).c_str(), in emitCode()
[all …]
DGrBicubicEffect.cpp47 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
48 SkString coords2D = fragBuilder->ensureCoords2D(args.fTransformedCoords[0]); in emitCode()
68 fragBuilder->codeAppend("half4x4 kMitchellCoefficients = half4x4(" in emitCode()
73 fragBuilder->codeAppendf("float2 coord = %s - %s * float2(0.5);", coords2D.c_str(), imgInc); in emitCode()
78 fragBuilder->codeAppendf("coord /= %s;", imgInc); in emitCode()
79 fragBuilder->codeAppend("float2 f = fract(coord);"); in emitCode()
80 fragBuilder->codeAppendf("coord = (coord - f + float2(0.5)) * %s;", imgInc); in emitCode()
81fragBuilder->codeAppend("half4 wx = kMitchellCoefficients * half4(1.0, f.x, f.x * f.x, f.x * f.x *… in emitCode()
82fragBuilder->codeAppend("half4 wy = kMitchellCoefficients * half4(1.0, f.y, f.y * f.y, f.y * f.y *… in emitCode()
83 fragBuilder->codeAppend("half4 rowColors[4];"); in emitCode()
[all …]
DGrMatrixConvolutionEffect.cpp66 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
67 SkString coords2D = fragBuilder->ensureCoords2D(args.fTransformedCoords[0]); in emitCode()
68 fragBuilder->codeAppend("half4 sum = half4(0, 0, 0, 0);"); in emitCode()
69fragBuilder->codeAppendf("float2 coord = %s - %s * %s;", coords2D.c_str(), kernelOffset, imgInc); in emitCode()
70 fragBuilder->codeAppend("half4 c;"); in emitCode()
75 GrGLSLShaderBuilder::ShaderBlock block(fragBuilder); in emitCode()
78 fragBuilder->codeAppendf("half k = %s[%d]%s;", kernel, offset / 4, in emitCode()
82 fDomain.sampleTexture(fragBuilder, in emitCode()
90 fragBuilder->codeAppend("c.rgb /= c.a;"); in emitCode()
91 fragBuilder->codeAppend("c.rgb = clamp(c.rgb, 0.0, 1.0);"); in emitCode()
[all …]
DGrGaussianConvolutionFragmentProcessor.cpp59 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
60 SkString coords2D = fragBuilder->ensureCoords2D(args.fTransformedCoords[0]); in emitCode()
62 fragBuilder->codeAppendf("%s = half4(0, 0, 0, 0);", args.fOutputColor); in emitCode()
67fragBuilder->codeAppendf("float2 coord = %s - %d.0 * %s;", coords2D.c_str(), ce.radius(), imgInc); in emitCode()
68 fragBuilder->codeAppend("float2 coordSampled = half2(0, 0);"); in emitCode()
79 fragBuilder->codeAppend("coordSampled = coord;"); in emitCode()
89 fragBuilder->codeAppendf("coordSampled.%s = clamp(coord.%s, %s.x, %s.y);\n", in emitCode()
94 fragBuilder->codeAppendf("coordSampled.%s = " in emitCode()
100 fragBuilder->codeAppendf("if (coord.%s >= %s.x && coord.%s <= %s.y) {", in emitCode()
109 fragBuilder->codeAppendf("%s += ", args.fOutputColor); in emitCode()
[all …]
/external/skqp/src/gpu/glsl/
DGrGLSLXferProcessor.cpp20 static void adjust_for_lcd_coverage(GrGLSLXPFragmentBuilder* fragBuilder, in adjust_for_lcd_coverage() argument
24 fragBuilder->codeAppendf("%s.a = max(max(%s.r, %s.g), %s.b);", in adjust_for_lcd_coverage()
37 GrGLSLXPFragmentBuilder* fragBuilder = args.fXPFragBuilder; in emitCode() local
39 const char* dstColor = fragBuilder->dstColor(); in emitCode()
55 fragBuilder->codeAppendf("if (all(lessThanEqual(%s.rgb, half3(0)))) {" in emitCode()
72 fragBuilder->codeAppend("// Read color from copy of the destination.\n"); in emitCode()
73 fragBuilder->codeAppendf("half2 _dstTexCoord = (sk_FragCoord.xy - %s) * %s;", in emitCode()
77 fragBuilder->codeAppend("_dstTexCoord.y = 1.0 - _dstTexCoord.y;"); in emitCode()
80 fragBuilder->codeAppendf("half4 %s = ", dstColor); in emitCode()
81 fragBuilder->appendTextureLookup(args.fDstTextureSamplerHandle, "_dstTexCoord", in emitCode()
[all …]
DGrGLSLFragmentProcessor.cpp30 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitChild() local
31 outputColor->append(fragBuilder->getMangleString()); in emitChild()
32 fragBuilder->codeAppendf("half4 %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()
46 fragBuilder->codeAppend("{\n"); in internalEmitChild()
47 fragBuilder->codeAppendf("// Child Index %d (mangle: %s): %s\n", childIndex, in internalEmitChild()
48 fragBuilder->getMangleString().c_str(), childProc.name()); in internalEmitChild()
52 EmitArgs childArgs(fragBuilder, in internalEmitChild()
62 fragBuilder->codeAppend("}\n"); in internalEmitChild()
[all …]
/external/skia/src/gpu/glsl/
DGrGLSLXferProcessor.cpp20 static void adjust_for_lcd_coverage(GrGLSLXPFragmentBuilder* fragBuilder, in adjust_for_lcd_coverage() argument
24 fragBuilder->codeAppendf("%s.a = max(max(%s.r, %s.g), %s.b);", in adjust_for_lcd_coverage()
37 GrGLSLXPFragmentBuilder* fragBuilder = args.fXPFragBuilder; in emitCode() local
39 const char* dstColor = fragBuilder->dstColor(); in emitCode()
55 fragBuilder->codeAppendf("if (all(lessThanEqual(%s.rgb, half3(0)))) {" in emitCode()
72 fragBuilder->codeAppend("// Read color from copy of the destination.\n"); in emitCode()
73 fragBuilder->codeAppendf("half2 _dstTexCoord = (sk_FragCoord.xy - %s) * %s;", in emitCode()
77 fragBuilder->codeAppend("_dstTexCoord.y = 1.0 - _dstTexCoord.y;"); in emitCode()
80 fragBuilder->codeAppendf("half4 %s = ", dstColor); in emitCode()
81 fragBuilder->appendTextureLookup(args.fDstTextureSamplerHandle, "_dstTexCoord", in emitCode()
[all …]
DGrGLSLFragmentProcessor.cpp30 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitChild() local
31 outputColor->append(fragBuilder->getMangleString()); in emitChild()
32 fragBuilder->codeAppendf("half4 %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()
46 fragBuilder->codeAppend("{\n"); in internalEmitChild()
47 fragBuilder->codeAppendf("// Child Index %d (mangle: %s): %s\n", childIndex, in internalEmitChild()
48 fragBuilder->getMangleString().c_str(), childProc.name()); in internalEmitChild()
52 EmitArgs childArgs(fragBuilder, in internalEmitChild()
62 fragBuilder->codeAppend("}\n"); in internalEmitChild()
[all …]
/external/skqp/src/shaders/gradients/
DSkTwoPointConicalGradient_gpu.cpp235 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
236 SkString coords2D = fragBuilder->ensureCoords2D(args.fTransformedCoords[0]); in emitCode()
240 fragBuilder->codeAppendf("half %s = length(%s) - %s;", tName, p, p0.c_str()); in emitCode()
244 fragBuilder->codeAppendf("%s = half4(0.0,0.0,0.0,0.0);", args.fOutputColor); in emitCode()
245 fragBuilder->codeAppendf("half temp = %s - %s.y * %s.y;", p0.c_str(), p, p); in emitCode()
246 fragBuilder->codeAppendf("if (temp >= 0) {"); in emitCode()
247 fragBuilder->codeAppendf("half %s = %s.x + sqrt(temp);", tName, p); in emitCode()
249 this->emitColor(fragBuilder, in emitCode()
259 fragBuilder->codeAppendf("}"); in emitCode()
298 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
[all …]
/external/skia/src/shaders/gradients/
DSkTwoPointConicalGradient_gpu.cpp235 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
236 SkString coords2D = fragBuilder->ensureCoords2D(args.fTransformedCoords[0]); in emitCode()
240 fragBuilder->codeAppendf("half %s = length(%s) - %s;", tName, p, p0.c_str()); in emitCode()
244 fragBuilder->codeAppendf("%s = half4(0.0,0.0,0.0,0.0);", args.fOutputColor); in emitCode()
245 fragBuilder->codeAppendf("half temp = %s - %s.y * %s.y;", p0.c_str(), p, p); in emitCode()
246 fragBuilder->codeAppendf("if (temp >= 0) {"); in emitCode()
247 fragBuilder->codeAppendf("half %s = %s.x + sqrt(temp);", tName, p); in emitCode()
249 this->emitColor(fragBuilder, in emitCode()
259 fragBuilder->codeAppendf("}"); in emitCode()
298 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; in emitCode() local
[all …]

123456