Home
last modified time | relevance | path

Searched refs:codeAppendf (Results 1 – 25 of 185) sorted by relevance

12345678

/external/skia/src/effects/
DSkHighContrastFilter.cpp249 fragBuilder->codeAppendf("half4 color = %s;", args.fInputColor); in emitCode()
252 fragBuilder->codeAppendf("half nonZeroAlpha = max(color.a, 0.00001);"); in emitCode()
253 fragBuilder->codeAppendf("color = half4(color.rgb / nonZeroAlpha, nonZeroAlpha);"); in emitCode()
261 fragBuilder->codeAppendf("half luma = dot(color, half4(%f, %f, %f, 0));", in emitCode()
263 fragBuilder->codeAppendf("color = half4(luma, luma, luma, 0);"); in emitCode()
267 fragBuilder->codeAppendf("color = half4(1, 1, 1, 1) - color;"); in emitCode()
272 fragBuilder->codeAppendf("half fmax = max(color.r, max(color.g, color.b));"); in emitCode()
273 fragBuilder->codeAppendf("half fmin = min(color.r, min(color.g, color.b));"); in emitCode()
274 fragBuilder->codeAppendf("half l = (fmax + fmin) / 2;"); in emitCode()
276 fragBuilder->codeAppendf("half h;"); in emitCode()
[all …]
/external/skqp/src/effects/
DSkHighContrastFilter.cpp247 fragBuilder->codeAppendf("half4 color = %s;", args.fInputColor); in emitCode()
250 fragBuilder->codeAppendf("half nonZeroAlpha = max(color.a, 0.00001);"); in emitCode()
251 fragBuilder->codeAppendf("color = half4(color.rgb / nonZeroAlpha, nonZeroAlpha);"); in emitCode()
259 fragBuilder->codeAppendf("half luma = dot(color, half4(%f, %f, %f, 0));", in emitCode()
261 fragBuilder->codeAppendf("color = half4(luma, luma, luma, 0);"); in emitCode()
265 fragBuilder->codeAppendf("color = half4(1, 1, 1, 1) - color;"); in emitCode()
270 fragBuilder->codeAppendf("half fmax = max(color.r, max(color.g, color.b));"); in emitCode()
271 fragBuilder->codeAppendf("half fmin = min(color.r, min(color.g, color.b));"); in emitCode()
272 fragBuilder->codeAppendf("half l = (fmax + fmin) / 2;"); in emitCode()
274 fragBuilder->codeAppendf("half h;"); in emitCode()
[all …]
/external/skqp/src/gpu/glsl/
DGrGLSLBlend.cpp24 fsBuilder->codeAppendf("if (2.0 * %s.%c <= %s.a) {", src, component, src); in hard_light()
25 fsBuilder->codeAppendf("%s.%c = 2.0 * %s.%c * %s.%c;", in hard_light()
28 fsBuilder->codeAppendf("%s.%c = %s.a * %s.a - 2.0 * (%s.a - %s.%c) * (%s.a - %s.%c);", in hard_light()
33 fsBuilder->codeAppendf("%s.rgb += %s.rgb * (1.0 - %s.a) + %s.rgb * (1.0 - %s.a);", in hard_light()
49 fsBuilder->codeAppendf("if (0.0 == %s.%c) {", dst, component); in color_dodge_component()
50 fsBuilder->codeAppendf("%s.%c = %s.%c * (1.0 - %s.a);", in color_dodge_component()
53 fsBuilder->codeAppendf("half d = %s.a - %s.%c;", src, src, component); in color_dodge_component()
55 fsBuilder->codeAppendf("%s.%c = %s.a * %s.a + %s.%c * (1.0 - %s.a) + %s.%c * (1.0 - %s.a);", in color_dodge_component()
59 fsBuilder->codeAppendf("d = min(%s.a, %s.%c * %s.a / (d %s));", in color_dodge_component()
61 fsBuilder->codeAppendf("%s.%c = d * %s.a + %s.%c * (1.0 - %s.a) + %s.%c * (1.0 - %s.a);", in color_dodge_component()
[all …]
DGrGLSLXferProcessor.cpp24 fragBuilder->codeAppendf("%s.a = max(max(%s.r, %s.g), %s.b);", in adjust_for_lcd_coverage()
55 fragBuilder->codeAppendf("if (all(lessThanEqual(%s.rgb, half3(0)))) {" in emitCode()
73 fragBuilder->codeAppendf("half2 _dstTexCoord = (sk_FragCoord.xy - %s) * %s;", in emitCode()
80 fragBuilder->codeAppendf("half4 %s = ", dstColor); in emitCode()
92 fragBuilder->codeAppendf("half4 %s;", outColor); in emitCode()
104 fragBuilder->codeAppendf("%s = %s;", args.fOutputPrimary, outColor); in emitCode()
137 fragBuilder->codeAppendf("%s *= %s;", outColor, srcCoverage); in DefaultCoverageModulation()
138 fragBuilder->codeAppendf("%s = %s;", outColorSecondary, srcCoverage); in DefaultCoverageModulation()
140 fragBuilder->codeAppendf("%s = half4(1.0);", outColorSecondary); in DefaultCoverageModulation()
144 fragBuilder->codeAppendf("half lerpRed = mix(%s.a, %s.a, %s.r);", in DefaultCoverageModulation()
[all …]
/external/skia/src/gpu/glsl/
DGrGLSLBlend.cpp24 fsBuilder->codeAppendf("if (2.0 * %s.%c <= %s.a) {", src, component, src); in hard_light()
25 fsBuilder->codeAppendf("%s.%c = 2.0 * %s.%c * %s.%c;", in hard_light()
28 fsBuilder->codeAppendf("%s.%c = %s.a * %s.a - 2.0 * (%s.a - %s.%c) * (%s.a - %s.%c);", in hard_light()
33 fsBuilder->codeAppendf("%s.rgb += %s.rgb * (1.0 - %s.a) + %s.rgb * (1.0 - %s.a);", in hard_light()
49 fsBuilder->codeAppendf("if (0.0 == %s.%c) {", dst, component); in color_dodge_component()
50 fsBuilder->codeAppendf("%s.%c = %s.%c * (1.0 - %s.a);", in color_dodge_component()
53 fsBuilder->codeAppendf("half d = %s.a - %s.%c;", src, src, component); in color_dodge_component()
55 fsBuilder->codeAppendf("%s.%c = %s.a * %s.a + %s.%c * (1.0 - %s.a) + %s.%c * (1.0 - %s.a);", in color_dodge_component()
59 fsBuilder->codeAppendf("d = min(%s.a, %s.%c * %s.a / (d %s));", in color_dodge_component()
61 fsBuilder->codeAppendf("%s.%c = d * %s.a + %s.%c * (1.0 - %s.a) + %s.%c * (1.0 - %s.a);", in color_dodge_component()
[all …]
DGrGLSLXferProcessor.cpp24 fragBuilder->codeAppendf("%s.a = max(max(%s.r, %s.g), %s.b);", in adjust_for_lcd_coverage()
55 fragBuilder->codeAppendf("if (all(lessThanEqual(%s.rgb, half3(0)))) {" in emitCode()
73 fragBuilder->codeAppendf("half2 _dstTexCoord = (half2(sk_FragCoord.xy) - %s) * %s;", in emitCode()
80 fragBuilder->codeAppendf("half4 %s = ", dstColor); in emitCode()
92 fragBuilder->codeAppendf("half4 %s;", outColor); in emitCode()
104 fragBuilder->codeAppendf("%s = %s;", args.fOutputPrimary, outColor); in emitCode()
137 fragBuilder->codeAppendf("%s *= %s;", outColor, srcCoverage); in DefaultCoverageModulation()
138 fragBuilder->codeAppendf("%s = %s;", outColorSecondary, srcCoverage); in DefaultCoverageModulation()
140 fragBuilder->codeAppendf("%s = half4(1.0);", outColorSecondary); in DefaultCoverageModulation()
144 fragBuilder->codeAppendf("half lerpRed = mix(%s.a, %s.a, %s.r);", in DefaultCoverageModulation()
[all …]
/external/skia/src/gpu/ccpr/
DGrCCCoverageProcessor_GSImpl.cpp56 g->codeAppendf("float%ix2 pts = transpose(float2x%i(sk_in[0].%s, sk_in[1].%s));", in emitGeometryShader()
65 g->codeAppendf("%s *= half(sk_in[0].sk_Position.w);", wind.c_str()); in emitGeometryShader()
141 g->codeAppendf("int i = (%s > 0 ? sk_InvocationID : 4 - sk_InvocationID) %% 3;", in onEmitGeometryShader()
144 g->codeAppendf("float2 right = pts[(i + (%s > 0 ? 1 : 2)) %% 3];", wind.c_str()); in onEmitGeometryShader()
145 g->codeAppendf("float2 left = pts[(i + (%s > 0 ? 2 : 1)) %% 3];", wind.c_str()); in onEmitGeometryShader()
181 g->codeAppendf("bool2 left_right_notequal = notEqual(leftbloat, rightbloat);"); in onEmitGeometryShader()
185 g->codeAppendf( "%s(top, float2(-leftbloat.y, +leftbloat.x), coverages[0]);", in onEmitGeometryShader()
190 g->codeAppendf( "%s(top, rightbloat, coverages[1]);", emitVertexFn); in onEmitGeometryShader()
194 g->codeAppendf("%s(top, leftbloat, coverages[2]);", emitVertexFn); in onEmitGeometryShader()
195 g->codeAppendf("%s(right, rightbloat, coverages[1]);", emitVertexFn); in onEmitGeometryShader()
[all …]
DGrCCCoverageProcessor.cpp37 f->codeAppendf("%s = %s;", outputCoverage, fCoverages.fsIn()); in onEmitFragmentCode()
39 f->codeAppendf("%s = %s.z * %s.y + %s.x;", in onEmitFragmentCode()
51 s->codeAppendf("float2 a = %s[0] - %s[1], " in CalcWind()
56 s->codeAppendf("float2 p12 = (%s[1] + %s[2]) * .5;", pts, pts); in CalcWind()
57 s->codeAppendf("float2 a = %s[0] - p12, " in CalcWind()
69 s->codeAppendf("%s = (abs(area_x2 * 1024) > basewidth) ? sign(half(area_x2)) : 0;", in CalcWind()
74 s->codeAppendf("%s = sign(half(area_x2));", outputWind); in CalcWind()
82 s->codeAppendf("float2 n = float2(%s.y - %s.y, %s.x - %s.x);", in EmitEdgeDistanceEquation()
88 s->codeAppendf("%s = float3(-n, dot(n, %s) - .5);", outputDistanceEquation, leftPt); in EmitEdgeDistanceEquation()
117 s->codeAppendf("float2 n = float2(%s.y - %s.y, %s.x - %s.x);", in CalcEdgeCoverageAtBloatVertex()
[all …]
DGrCCConicShader.cpp18 s->codeAppendf("float x0 = %s[0].x - %s[1].x, x2 = %s[2].x - %s[1].x;", pts, pts, pts, pts); in emitSetupCode()
19 s->codeAppendf("float y0 = %s[0].y - %s[1].y, y2 = %s[2].y - %s[1].y;", pts, pts, pts, pts); in emitSetupCode()
20 s->codeAppendf("float w = %s[3].x;", pts); in emitSetupCode()
21 s->codeAppendf("%s = float3x3(y2 - y0, x0 - x2, x2*y0 - x0*y2, " in emitSetupCode()
26 s->codeAppendf("%s = %s[1];", fControlPoint.c_str(), pts); in emitSetupCode()
30 s->codeAppendf("float kwidth = 2*bloat * %s * (abs(%s[0].x) + abs(%s[0].y));", in emitSetupCode()
32 s->codeAppendf("%s *= 1/kwidth;", fKLMMatrix.c_str()); in emitSetupCode()
38 s->codeAppendf("float2 p1w = %s[1]*w;", pts); in emitSetupCode()
41 s->codeAppendf("conic_hull[0] = %s[0];", pts); in emitSetupCode()
42 s->codeAppendf("conic_hull[1] = (%s[0] + p1w) * r;", pts); in emitSetupCode()
[all …]
DGrCCQuadraticShader.cpp16 s->codeAppendf("%s = float2x2(1, 1, .5, 0) * inverse(float2x2(%s[2] - %s[0], %s[1] - %s[0]));", in emitSetupCode()
20 s->codeAppendf("%s = %s[0];", fQCoord0.c_str(), pts); in emitSetupCode()
23 s->codeAppendf("float2 edgept0 = %s[%s > 0 ? 2 : 0];", pts, wind); in emitSetupCode()
24 s->codeAppendf("float2 edgept1 = %s[%s > 0 ? 0 : 2];", pts, wind); in emitSetupCode()
32 s->codeAppendf("quadratic_hull[0] = %s[0];", pts); in emitSetupCode()
33 s->codeAppendf("quadratic_hull[1] = (%s[0] + %s[1]) * .5;", pts, pts); in emitSetupCode()
34 s->codeAppendf("quadratic_hull[2] = (%s[1] + %s[2]) * .5;", pts, pts); in emitSetupCode()
35 s->codeAppendf("quadratic_hull[3] = %s[2];", pts); in emitSetupCode()
72 f->codeAppendf("%s *= half(%s.y);", outputCoverage, fEdge_fWind_fCorner.fsIn()); // Wind. in onEmitFragmentCode()
75 f->codeAppendf("%s = half(%s.z * %s.w) + %s;",// Attenuated corner coverage. in onEmitFragmentCode()
DGrCCCubicShader.cpp19 s->codeAppendf("float2x4 C = float4x4(-1, 3, -3, 1, " in emitSetupCode()
69 s->codeAppendf("%s = CI * float3x3(K[0], K[middlerow], K[3], " in emitSetupCode()
74 s->codeAppendf("float2 midpoint = %s * float4(.125, .375, .375, .125);", pts); in emitSetupCode()
77 s->codeAppendf("float2 orientation = sign(float3(midpoint, 1) * float2x3(%s[1], %s[2]));", in emitSetupCode()
79 s->codeAppendf("%s *= float3x3(orientation[0] * orientation[1], 0, 0, " in emitSetupCode()
85 s->codeAppendf("int edgeidx0 = %s > 0 ? 3 : 0;", wind); in emitSetupCode()
86 s->codeAppendf("float2 edgept0 = %s[edgeidx0];", pts); in emitSetupCode()
87 s->codeAppendf("float2 edgept1 = %s[3 - edgeidx0];", pts); in emitSetupCode()
132 f->codeAppendf("%s *= wind;", outputCoverage); in onEmitFragmentCode()
135 f->codeAppendf("%s = %s.x * %s.y + %s;", // Attenuated corner coverage. in onEmitFragmentCode()
/external/skqp/src/gpu/ccpr/
DGrCCCoverageProcessor_GSImpl.cpp56 g->codeAppendf("float%ix2 pts = transpose(float2x%i(sk_in[0].%s, sk_in[1].%s));", in emitGeometryShader()
65 g->codeAppendf("%s *= sk_in[0].sk_Position.w;", wind.c_str()); in emitGeometryShader()
141 g->codeAppendf("int i = (%s > 0 ? sk_InvocationID : 4 - sk_InvocationID) %% 3;", in onEmitGeometryShader()
144 g->codeAppendf("float2 right = pts[(i + (%s > 0 ? 1 : 2)) %% 3];", wind.c_str()); in onEmitGeometryShader()
145 g->codeAppendf("float2 left = pts[(i + (%s > 0 ? 2 : 1)) %% 3];", wind.c_str()); in onEmitGeometryShader()
181 g->codeAppendf("bool2 left_right_notequal = notEqual(leftbloat, rightbloat);"); in onEmitGeometryShader()
185 g->codeAppendf( "%s(top, float2(-leftbloat.y, +leftbloat.x), coverages[0]);", in onEmitGeometryShader()
190 g->codeAppendf( "%s(top, rightbloat, coverages[1]);", emitVertexFn); in onEmitGeometryShader()
194 g->codeAppendf("%s(top, leftbloat, coverages[2]);", emitVertexFn); in onEmitGeometryShader()
195 g->codeAppendf("%s(right, rightbloat, coverages[1]);", emitVertexFn); in onEmitGeometryShader()
[all …]
DGrCCCoverageProcessor.cpp37 f->codeAppendf("%s = %s;", outputCoverage, fCoverages.fsIn()); in onEmitFragmentCode()
39 f->codeAppendf("%s = %s.z * %s.y + %s.x;", in onEmitFragmentCode()
51 s->codeAppendf("float2 a = %s[0] - %s[1], " in CalcWind()
56 s->codeAppendf("float2 p12 = (%s[1] + %s[2]) * .5;", pts, pts); in CalcWind()
57 s->codeAppendf("float2 a = %s[0] - p12, " in CalcWind()
69 s->codeAppendf("%s = (abs(area_x2 * 1024) > basewidth) ? sign(area_x2) : 0;", outputWind); in CalcWind()
73 s->codeAppendf("%s = sign(area_x2);", outputWind); in CalcWind()
81 s->codeAppendf("float2 n = float2(%s.y - %s.y, %s.x - %s.x);", in EmitEdgeDistanceEquation()
87 s->codeAppendf("%s = float3(-n, dot(n, %s) - .5);", outputDistanceEquation, leftPt); in EmitEdgeDistanceEquation()
116 s->codeAppendf("float2 n = float2(%s.y - %s.y, %s.x - %s.x);", in CalcEdgeCoverageAtBloatVertex()
[all …]
DGrCCConicShader.cpp18 s->codeAppendf("float x0 = %s[0].x - %s[1].x, x2 = %s[2].x - %s[1].x;", pts, pts, pts, pts); in emitSetupCode()
19 s->codeAppendf("float y0 = %s[0].y - %s[1].y, y2 = %s[2].y - %s[1].y;", pts, pts, pts, pts); in emitSetupCode()
20 s->codeAppendf("float w = %s[3].x;", pts); in emitSetupCode()
21 s->codeAppendf("%s = float3x3(y2 - y0, x0 - x2, x2*y0 - x0*y2, " in emitSetupCode()
26 s->codeAppendf("%s = %s[1];", fControlPoint.c_str(), pts); in emitSetupCode()
30 s->codeAppendf("float kwidth = 2*bloat * %s * (abs(%s[0].x) + abs(%s[0].y));", in emitSetupCode()
32 s->codeAppendf("%s *= 1/kwidth;", fKLMMatrix.c_str()); in emitSetupCode()
38 s->codeAppendf("float2 p1w = %s[1]*w;", pts); in emitSetupCode()
41 s->codeAppendf("conic_hull[0] = %s[0];", pts); in emitSetupCode()
42 s->codeAppendf("conic_hull[1] = (%s[0] + p1w) * r;", pts); in emitSetupCode()
[all …]
DGrCCQuadraticShader.cpp16 s->codeAppendf("%s = float2x2(1, 1, .5, 0) * inverse(float2x2(%s[2] - %s[0], %s[1] - %s[0]));", in emitSetupCode()
20 s->codeAppendf("%s = %s[0];", fQCoord0.c_str(), pts); in emitSetupCode()
23 s->codeAppendf("float2 edgept0 = %s[%s > 0 ? 2 : 0];", pts, wind); in emitSetupCode()
24 s->codeAppendf("float2 edgept1 = %s[%s > 0 ? 0 : 2];", pts, wind); in emitSetupCode()
32 s->codeAppendf("quadratic_hull[0] = %s[0];", pts); in emitSetupCode()
33 s->codeAppendf("quadratic_hull[1] = (%s[0] + %s[1]) * .5;", pts, pts); in emitSetupCode()
34 s->codeAppendf("quadratic_hull[2] = (%s[1] + %s[2]) * .5;", pts, pts); in emitSetupCode()
35 s->codeAppendf("quadratic_hull[3] = %s[2];", pts); in emitSetupCode()
72 f->codeAppendf("%s *= %s.y;", outputCoverage, fEdge_fWind_fCorner.fsIn()); // Wind. in onEmitFragmentCode()
75 f->codeAppendf("%s = %s.z * %s.w + %s;",// Attenuated corner coverage. in onEmitFragmentCode()
DGrCCCubicShader.cpp19 s->codeAppendf("float2x4 C = float4x4(-1, 3, -3, 1, " in emitSetupCode()
69 s->codeAppendf("%s = CI * float3x3(K[0], K[middlerow], K[3], " in emitSetupCode()
74 s->codeAppendf("float2 midpoint = %s * float4(.125, .375, .375, .125);", pts); in emitSetupCode()
77 s->codeAppendf("float2 orientation = sign(float3(midpoint, 1) * float2x3(%s[1], %s[2]));", in emitSetupCode()
79 s->codeAppendf("%s *= float3x3(orientation[0] * orientation[1], 0, 0, " in emitSetupCode()
85 s->codeAppendf("int edgeidx0 = %s > 0 ? 3 : 0;", wind); in emitSetupCode()
86 s->codeAppendf("float2 edgept0 = %s[edgeidx0];", pts); in emitSetupCode()
87 s->codeAppendf("float2 edgept1 = %s[3 - edgeidx0];", pts); in emitSetupCode()
132 f->codeAppendf("%s *= wind;", outputCoverage); in onEmitFragmentCode()
135 f->codeAppendf("%s = %s.x * %s.y + %s;", // Attenuated corner coverage. in onEmitFragmentCode()
/external/skia/gm/
Dsamplelocations.cpp90 v->codeAppendf("int x = sk_InstanceID %% 200;"); in onEmitCode()
91 v->codeAppendf("int y = sk_InstanceID / 200;"); in onEmitCode()
96 v->codeAppendf("int ileft = (sk_InstanceID*929) %% 17;"); in onEmitCode()
97 v->codeAppendf("int iright = ileft + 1 + ((sk_InstanceID*1637) %% (17 - ileft));"); in onEmitCode()
98 v->codeAppendf("int itop = (sk_InstanceID*313) %% 17;"); in onEmitCode()
99 v->codeAppendf("int ibot = itop + 1 + ((sk_InstanceID*1901) %% (17 - itop));"); in onEmitCode()
104 v->codeAppendf("float outset = 1/32.0;"); in onEmitCode()
105 v->codeAppendf("outset = (0 == (x + y) %% 2) ? -outset : +outset;"); in onEmitCode()
106 v->codeAppendf("float l = ileft/16.0 - outset;"); in onEmitCode()
107 v->codeAppendf("float r = iright/16.0 + outset;"); in onEmitCode()
[all …]
Dfwidth_squircle.cpp71 v->codeAppendf("float2x2 R = float2x2(cos(.05), sin(.05), -sin(.05), cos(.05));"); in onEmitCode()
73 v->codeAppendf("%s = bboxcoord * 1.25;", squircleCoord.vsOut()); in onEmitCode()
74 v->codeAppendf("float3 vertexpos = float3(bboxcoord * 100 * R + 100, 1);"); in onEmitCode()
75 v->codeAppendf("vertexpos = %s * vertexpos;", uniforms->getUniformCStr(fViewMatrixHandle)); in onEmitCode()
79 f->codeAppendf("float golden_ratio = 1.61803398875;"); in onEmitCode()
80 f->codeAppendf("float pi = 3.141592653589793;"); in onEmitCode()
81 f->codeAppendf("float x = abs(%s.x), y = abs(%s.y);", in onEmitCode()
85 f->codeAppendf("float fn = half(pow(x, golden_ratio*pi) + pow(y, golden_ratio*pi) - 1);"); in onEmitCode()
86 f->codeAppendf("float fnwidth = fwidth(fn);"); in onEmitCode()
87 f->codeAppendf("fnwidth += 1e-10;"); // Guard against divide-by-zero. in onEmitCode()
[all …]
/external/skia/src/gpu/effects/
DGrBezierEffect.cpp80 vertBuilder->codeAppendf("%s = %s;", v.vsOut(), gp.inConicCoeffs().name()); in onEmitCode()
126 fragBuilder->codeAppendf("%s = dFdx(%s.xyz);", dklmdx.c_str(), v.fsIn()); in onEmitCode()
127 fragBuilder->codeAppendf("%s = dFdy(%s.xyz);", dklmdy.c_str(), v.fsIn()); in onEmitCode()
128 fragBuilder->codeAppendf("%s = 2.0 * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;", in onEmitCode()
133 fragBuilder->codeAppendf("%s = 2.0 * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;", in onEmitCode()
138 fragBuilder->codeAppendf("%s = float2(%s, %s);", gF.c_str(), dfdx.c_str(), in onEmitCode()
140 fragBuilder->codeAppendf("%s = sqrt(dot(%s, %s));", in onEmitCode()
142 fragBuilder->codeAppendf("%s = %s.x*%s.x - %s.y*%s.z;", in onEmitCode()
144 fragBuilder->codeAppendf("%s = abs(%s);", func.c_str(), func.c_str()); in onEmitCode()
145 fragBuilder->codeAppendf("%s = half(%s / %s);", in onEmitCode()
[all …]
DGrRRectEffect.cpp193 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()
196 fragBuilder->codeAppendf("half alpha = half(%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 = half(saturate(%s.z - sk_FragCoord.x));", in emitCode()
203 fragBuilder->codeAppendf("half bottomAlpha = half(saturate(%s.w - sk_FragCoord.y));", in emitCode()
205 fragBuilder->codeAppendf("half alpha = bottomAlpha * rightAlpha * half(%s);", in emitCode()
209 fragBuilder->codeAppendf("float2 dxy = max(float2(sk_FragCoord.x - %s.z, " in emitCode()
212 fragBuilder->codeAppendf("half leftAlpha = half(saturate(sk_FragCoord.x - %s.x));", in emitCode()
214 fragBuilder->codeAppendf("half bottomAlpha = half(saturate(%s.w - sk_FragCoord.y));", in emitCode()
[all …]
DGrDistanceFieldGeoProc.cpp85 fragBuilder->codeAppendf("float2 uv = %s;\n", uv.fsIn()); in onEmitCode()
94 fragBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName); in onEmitCode()
105 fragBuilder->codeAppendf("afwidth = abs(" SK_DistanceFieldAAFactor in onEmitCode()
109 fragBuilder->codeAppendf("afwidth = abs(" SK_DistanceFieldAAFactor in onEmitCode()
120 fragBuilder->codeAppendf("half st_grad_len = length(half2(dFdx(%s)));", st.fsIn()); in onEmitCode()
123 fragBuilder->codeAppendf("half st_grad_len = length(half2(dFdy(%s)));", st.fsIn()); in onEmitCode()
141 fragBuilder->codeAppendf("half2 Jdx = half2(dFdx(%s));", st.fsIn()); in onEmitCode()
142 fragBuilder->codeAppendf("half2 Jdy = half2(dFdy(%s));", st.fsIn()); in onEmitCode()
162 fragBuilder->codeAppendf("%s = half4(val);", args.fOutputCoverage); in onEmitCode()
385 fragBuilder->codeAppendf("float2 uv = %s;", uv.fsIn()); in onEmitCode()
[all …]
/external/skqp/src/gpu/effects/
DGrBezierEffect.cpp80 vertBuilder->codeAppendf("%s = %s;", v.vsOut(), gp.inConicCoeffs().name()); in onEmitCode()
126 fragBuilder->codeAppendf("%s = dFdx(%s.xyz);", dklmdx.c_str(), v.fsIn()); in onEmitCode()
127 fragBuilder->codeAppendf("%s = dFdy(%s.xyz);", dklmdy.c_str(), v.fsIn()); in onEmitCode()
128 fragBuilder->codeAppendf("%s = 2.0 * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;", in onEmitCode()
133 fragBuilder->codeAppendf("%s = 2.0 * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;", in onEmitCode()
138 fragBuilder->codeAppendf("%s = float2(%s, %s);", gF.c_str(), dfdx.c_str(), in onEmitCode()
140 fragBuilder->codeAppendf("%s = sqrt(dot(%s, %s));", in onEmitCode()
142 fragBuilder->codeAppendf("%s = %s.x*%s.x - %s.y*%s.z;", in onEmitCode()
144 fragBuilder->codeAppendf("%s = abs(%s);", func.c_str(), func.c_str()); in onEmitCode()
145 fragBuilder->codeAppendf("%s = %s / %s;", in onEmitCode()
[all …]
DGrRRectEffect.cpp193 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()
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 = saturate(%s.z - sk_FragCoord.x);", in emitCode()
203 fragBuilder->codeAppendf("half bottomAlpha = saturate(%s.w - sk_FragCoord.y);", 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()
212 fragBuilder->codeAppendf("half leftAlpha = saturate(sk_FragCoord.x - %s.x);", in emitCode()
214 fragBuilder->codeAppendf("half bottomAlpha = saturate(%s.w - sk_FragCoord.y);", in emitCode()
[all …]
DGrDistanceFieldGeoProc.cpp86 fragBuilder->codeAppendf("float2 uv = %s;\n", uv.fsIn()); in onEmitCode()
95 fragBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName); in onEmitCode()
106 fragBuilder->codeAppendf("afwidth = abs(" SK_DistanceFieldAAFactor "*dFdx(%s.x));", in onEmitCode()
110 fragBuilder->codeAppendf("afwidth = abs(" SK_DistanceFieldAAFactor "*dFdy(%s.y));", in onEmitCode()
121 fragBuilder->codeAppendf("half st_grad_len = length(dFdx(%s));", st.fsIn()); in onEmitCode()
124 fragBuilder->codeAppendf("half st_grad_len = length(dFdy(%s));", st.fsIn()); in onEmitCode()
141 fragBuilder->codeAppendf("half2 Jdx = dFdx(%s);", st.fsIn()); in onEmitCode()
142 fragBuilder->codeAppendf("half2 Jdy = dFdy(%s);", st.fsIn()); in onEmitCode()
162 fragBuilder->codeAppendf("%s = half4(val);", args.fOutputCoverage); in onEmitCode()
386 fragBuilder->codeAppendf("float2 uv = %s;", uv.fsIn()); in onEmitCode()
[all …]
/external/skqp/gm/
Dfwidth_squircle.cpp74 v->codeAppendf("float2x2 R = float2x2(cos(.05), sin(.05), -sin(.05), cos(.05));"); in onEmitCode()
76 v->codeAppendf("%s = bboxcoord * 1.25;", squircleCoord.vsOut()); in onEmitCode()
77 v->codeAppendf("float3 vertexpos = float3(bboxcoord * 100 * R + 100, 1);"); in onEmitCode()
78 v->codeAppendf("vertexpos = %s * vertexpos;", uniforms->getUniformCStr(fViewMatrixHandle)); in onEmitCode()
82 f->codeAppendf("float golden_ratio = 1.61803398875;"); in onEmitCode()
83 f->codeAppendf("float pi = 3.141592653589793;"); in onEmitCode()
84 f->codeAppendf("float x = abs(%s.x), y = abs(%s.y);", in onEmitCode()
88 f->codeAppendf("float fn = pow(x, golden_ratio*pi) + pow(y, golden_ratio*pi) - 1;"); in onEmitCode()
89 f->codeAppendf("float fnwidth = fwidth(fn);"); in onEmitCode()
90 f->codeAppendf("fnwidth += 1e-10;"); // Guard against divide-by-zero. in onEmitCode()
[all …]

12345678