Home
last modified time | relevance | path

Searched refs:codeAppend (Results 1 – 25 of 82) sorted by relevance

1234

/third_party/flutter/skia/src/gpu/ccpr/
DGrCCCubicShader.cpp25 s->codeAppend ("float D3 = +determinant(float2x2(C[0].yz, C[1].yz));"); in emitSetupCode()
26 s->codeAppend ("float D2 = -determinant(float2x2(C[0].xz, C[1].xz));"); in emitSetupCode()
27 s->codeAppend ("float D1 = +determinant(float2x2(C));"); in emitSetupCode()
31 s->codeAppend ("float Dmax = max(max(abs(D1), abs(D2)), abs(D3));"); in emitSetupCode()
32 s->codeAppend ("float norm;"); in emitSetupCode()
34 s->codeAppend ("int exp;"); in emitSetupCode()
35 s->codeAppend ("frexp(Dmax, exp);"); in emitSetupCode()
36 s->codeAppend ("norm = ldexp(1, 1 - exp);"); in emitSetupCode()
38 s->codeAppend ("norm = 1/Dmax;"); // Dmax will not be 0 because we cull line cubics on CPU. in emitSetupCode()
40 s->codeAppend ("D3 *= norm;"); in emitSetupCode()
[all …]
DGrVSCoverageProcessor.cpp264 v->codeAppend ("half wind;"); in onEmitCode()
306 v->codeAppend ("float2 leftbloat = sign(corner - left);"); in onEmitCode()
307 v->codeAppend ("leftbloat = float2(0 != leftbloat.y ? leftbloat.y : leftbloat.x, " in onEmitCode()
310 v->codeAppend ("float2 rightbloat = sign(right - corner);"); in onEmitCode()
311 v->codeAppend ("rightbloat = float2(0 != rightbloat.y ? rightbloat.y : rightbloat.x, " in onEmitCode()
314 v->codeAppend ("bool2 left_right_notequal = notEqual(leftbloat, rightbloat);"); in onEmitCode()
316 v->codeAppend ("float2 bloatdir = leftbloat;"); in onEmitCode()
318 v->codeAppend ("float2 leftdir = corner - left;"); in onEmitCode()
319 v->codeAppend ("leftdir = (float2(0) != leftdir) ? normalize(leftdir) : float2(1, 0);"); in onEmitCode()
321 v->codeAppend ("float2 rightdir = right - corner;"); in onEmitCode()
[all …]
DGrGSCoverageProcessor.cpp123 g->codeAppend ("float nwidth = bloat*2 * (abs(n.x) + abs(n.y));"); in emitGeometryShader()
126 g->codeAppend ("n /= (0 != nwidth) ? nwidth : 1;"); in emitGeometryShader()
170 g->codeAppend ("float2 top = pts[i];"); in onEmitGeometryShader()
175 g->codeAppend ("float2 leftbloat = sign(top - left);"); in onEmitGeometryShader()
176 g->codeAppend ("leftbloat = float2(0 != leftbloat.y ? leftbloat.y : leftbloat.x, " in onEmitGeometryShader()
179 g->codeAppend ("float2 rightbloat = sign(right - top);"); in onEmitGeometryShader()
180 g->codeAppend ("rightbloat = float2(0 != rightbloat.y ? rightbloat.y : rightbloat.x, " in onEmitGeometryShader()
183 g->codeAppend ("float2 downbloat = sign(left - right);"); in onEmitGeometryShader()
184 g->codeAppend ("downbloat = float2(0 != downbloat.y ? downbloat.y : downbloat.x, " in onEmitGeometryShader()
188 g->codeAppend ("half4 coverages = half4(+1);"); in onEmitGeometryShader()
[all …]
DGrCCStroker.cpp107 v->codeAppend ("float2 tan = normalize(endpts.zw - endpts.xy);"); in onEmitCode()
108 v->codeAppend ("float2 n = float2(tan.y, -tan.x);"); in onEmitCode()
109 v->codeAppend ("float nwidth = abs(n.x) + abs(n.y);"); in onEmitCode()
112 v->codeAppend ("float2 outset = tan*nwidth/2;"); in onEmitCode()
113 v->codeAppend ("float2 position = (sk_VertexID < 2) " in onEmitCode()
126 v->codeAppend ("outset = n * (stroke_radius + nwidth/2);"); in onEmitCode()
127 v->codeAppend ("position += (0 == (sk_VertexID & 1)) ? +outset : -outset;"); in onEmitCode()
198 v->codeAppend ("float4x2 P = transpose(float2x4(X, Y));"); in onEmitCode()
199 v->codeAppend ("float stroke_radius = stroke_info[0];"); in onEmitCode()
200 v->codeAppend ("float num_segments = stroke_info[1];"); in onEmitCode()
[all …]
DGrCCClipProcessor.cpp60 f->codeAppend ("half coverage;"); in emitCode()
77 f->codeAppend ("coverage = "); in emitCode()
79 f->codeAppend (".a;"); in emitCode()
84 f->codeAppend ("half t = mod(abs(coverage), 2);"); in emitCode()
85 f->codeAppend ("coverage = 1 - abs(t - 1);"); in emitCode()
88 f->codeAppend ("coverage = min(abs(coverage), 1);"); in emitCode()
93 f->codeAppend ("} else {"); in emitCode()
94 f->codeAppend ( "coverage = 0;"); in emitCode()
95 f->codeAppend ("}"); in emitCode()
99 f->codeAppend ("coverage = 1 - coverage;"); in emitCode()
DGrCCCoverageProcessor.cpp65 s->codeAppend ("float area_x2 = determinant(float2x2(a, b));"); in CalcWind()
71 s->codeAppend ("float2 bbox_size = max(abs(a), abs(b));"); in CalcWind()
72 s->codeAppend ("float basewidth = max(bbox_size.x + bbox_size.y, 1);"); in CalcWind()
110 s->codeAppend ("float nwidth = abs(n.x) + abs(n.y);"); in CalcEdgeCoverageAtBloatVertex()
127 s->codeAppend ("float nwidth = abs(n.x) + abs(n.y);"); in CalcEdgeCoveragesAtBloatVertices()
152 s->codeAppend ("half axis_alignedness = " in CalcCornerAttenuation()
159 s->codeAppend ("ninety_degreesness = ninety_degreesness * ninety_degreesness;"); in CalcCornerAttenuation()
/third_party/skia/src/gpu/ops/
DFillRRectOp.cpp597 v->codeAppend("float2 corner = corner_and_radius_outsets.xy;"); in onEmitCode()
598 v->codeAppend("float2 radius_outset = corner_and_radius_outsets.zw;"); in onEmitCode()
599 v->codeAppend("float2 aa_bloat_direction = aa_bloat_and_coverage.xy;"); in onEmitCode()
600 v->codeAppend("float is_linear_coverage = aa_bloat_and_coverage.w;"); in onEmitCode()
603 v->codeAppend("float2 pixellength = inversesqrt(" in onEmitCode()
605 v->codeAppend("float4 normalized_axis_dirs = skew * pixellength.xyxy;"); in onEmitCode()
606 v->codeAppend("float2 axiswidths = (abs(normalized_axis_dirs.xy) + " in onEmitCode()
608 v->codeAppend("float2 aa_bloatradius = axiswidths * pixellength * .5;"); in onEmitCode()
611 v->codeAppend("float4 radii_and_neighbors = radii_selector" in onEmitCode()
613 v->codeAppend("float2 radii = radii_and_neighbors.xy;"); in onEmitCode()
[all …]
/third_party/flutter/skia/src/gpu/ops/
DGrFillRRectOp.cpp388 v->codeAppend("float2 corner = corner_and_radius_outsets.xy;"); in onEmitCode()
389 v->codeAppend("float2 radius_outset = corner_and_radius_outsets.zw;"); in onEmitCode()
390 v->codeAppend("float2 aa_bloat_direction = aa_bloat_and_coverage.xy;"); in onEmitCode()
391 v->codeAppend("float coverage = aa_bloat_and_coverage.z;"); in onEmitCode()
392 v->codeAppend("float is_linear_coverage = aa_bloat_and_coverage.w;"); in onEmitCode()
395 v->codeAppend("float2 pixellength = inversesqrt(" in onEmitCode()
397 v->codeAppend("float4 normalized_axis_dirs = skew * pixellength.xyxy;"); in onEmitCode()
398 v->codeAppend("float2 axiswidths = (abs(normalized_axis_dirs.xy) + " in onEmitCode()
400 v->codeAppend("float2 aa_bloatradius = axiswidths * pixellength * .5;"); in onEmitCode()
403 v->codeAppend("float4 radii_and_neighbors = radii_selector" in onEmitCode()
[all …]
/third_party/flutter/skia/src/gpu/effects/
DGrAtlasedShaderHelpers.h32 … args.fVertBuilder->codeAppend("int texIdx = 4*(signedCoords.x & 0x3) + (signedCoords.y & 0x3);"); in append_index_uv_varyings()
33 …args.fVertBuilder->codeAppend("float2 unormTexCoords = float2(signedCoords.x/4, signedCoords.y/4);… in append_index_uv_varyings()
35 … args.fVertBuilder->codeAppend("int texIdx = 2*(signedCoords.x & 0x1) + (signedCoords.y & 0x1);"); in append_index_uv_varyings()
36 …args.fVertBuilder->codeAppend("float2 unormTexCoords = float2(signedCoords.x/2, signedCoords.y/2);… in append_index_uv_varyings()
42 args.fVertBuilder->codeAppend("float2 unormTexCoords = floor(0.25*indexTexCoords);"); in append_index_uv_varyings()
43 … args.fVertBuilder->codeAppend("float2 diff0 = indexTexCoords - 2.0*floor(0.5*indexTexCoords);"); in append_index_uv_varyings()
44 …args.fVertBuilder->codeAppend("float2 diff1 = floor(0.5*indexTexCoords) - 2.0*floor(0.25*indexTexC… in append_index_uv_varyings()
45 …args.fVertBuilder->codeAppend("float texIdx = 8.0*diff1.x + 4.0*diff0.x + 2.0*diff1.y + diff0.y;"); in append_index_uv_varyings()
47 args.fVertBuilder->codeAppend("float2 unormTexCoords = floor(0.5*indexTexCoords);"); in append_index_uv_varyings()
48 args.fVertBuilder->codeAppend("float2 diff = indexTexCoords - 2.0*unormTexCoords;"); in append_index_uv_varyings()
[all …]
DGrDistanceFieldGeoProc.cpp86 fragBuilder->codeAppend("half4 texColor;"); in onEmitCode()
90 fragBuilder->codeAppend("half distance = " in onEmitCode()
97 fragBuilder->codeAppend("half afwidth;"); in onEmitCode()
125 fragBuilder->codeAppend("afwidth = abs(" SK_DistanceFieldAAFactor "*st_grad_len);"); in onEmitCode()
130 fragBuilder->codeAppend("half2 dist_grad = half2(float2(dFdx(distance), " in onEmitCode()
134 fragBuilder->codeAppend("half dg_len2 = dot(dist_grad, dist_grad);"); in onEmitCode()
135 fragBuilder->codeAppend("if (dg_len2 < 0.0001) {"); in onEmitCode()
136 fragBuilder->codeAppend("dist_grad = half2(0.7071, 0.7071);"); in onEmitCode()
137 fragBuilder->codeAppend("} else {"); in onEmitCode()
138 fragBuilder->codeAppend("dist_grad = dist_grad*half(inversesqrt(dg_len2));"); in onEmitCode()
[all …]
DGrBicubicEffect.cpp69 fragBuilder->codeAppend("half4x4 kMitchellCoefficients = half4x4(" in emitCode()
82 fragBuilder->codeAppend( in emitCode()
84 fragBuilder->codeAppend( in emitCode()
86 fragBuilder->codeAppend("half4 rowColors[4];"); in emitCode()
106 fragBuilder->codeAppend( in emitCode()
110 fragBuilder->codeAppend("half v = f.x + f.y;"); in emitCode()
111 fragBuilder->codeAppend("half v2 = v * v;"); in emitCode()
112 fragBuilder->codeAppend("half4 w = kMitchellCoefficients * half4(1.0, v, v2, v2 * v);"); in emitCode()
113 fragBuilder->codeAppend("half4 c[4];"); in emitCode()
130 fragBuilder->codeAppend( in emitCode()
[all …]
DGrShadowGeoProc.cpp29 fragBuilder->codeAppend("half3 shadowParams;"); in onEmitCode()
45 fragBuilder->codeAppend("half d = length(shadowParams.xy);"); in onEmitCode()
46 fragBuilder->codeAppend("half distance = shadowParams.z * (1.0 - d);"); in onEmitCode()
48 fragBuilder->codeAppend("half factor = 1.0 - clamp(distance, 0.0, 1.0);"); in onEmitCode()
49 fragBuilder->codeAppend("factor = exp(-factor * factor * 4.0) - 0.018;"); in onEmitCode()
DGrConvexPolyEffect.cpp50 fragBuilder->codeAppend("\t\thalf alpha = 1.0;\n"); in emitCode()
51 fragBuilder->codeAppend("\t\thalf edge;\n"); in emitCode()
58 fragBuilder->codeAppend("\t\tedge = saturate(edge);\n"); in emitCode()
60 fragBuilder->codeAppend("\t\tedge = edge >= 0.5 ? 1.0 : 0.0;\n"); in emitCode()
62 fragBuilder->codeAppend("\t\talpha *= edge;\n"); in emitCode()
66 fragBuilder->codeAppend("\talpha = 1.0 - alpha;\n"); in emitCode()
DGrRRectEffect.cpp195 fragBuilder->codeAppend("float2 dxy = max(max(dxy0, dxy1), 0.0);"); in emitCode()
243 fragBuilder->codeAppend("float2 dxy = max(float2(dxy0.x, max(dxy0.y, dy1)), 0.0);"); in emitCode()
252 fragBuilder->codeAppend("float2 dxy = max(float2(max(dxy0.x, dx1), dxy0.y), 0.0);"); in emitCode()
261 fragBuilder->codeAppend("float2 dxy = max(float2(dxy1.x, max(dy0, dxy1.y)), 0.0);"); in emitCode()
270 fragBuilder->codeAppend("float2 dxy = max(float2(max(dx0, dxy1.x), dxy1.y), 0.0);"); in emitCode()
279 fragBuilder->codeAppend("alpha = 1.0 - alpha;"); in emitCode()
542 fragBuilder->codeAppend("float2 dxy = max(max(dxy0, dxy1), 0.0);"); in emitCode()
560 fragBuilder->codeAppend("float2 dxy = max(max(dxy0, dxy1), 0.0);"); in emitCode()
573 fragBuilder->codeAppend("half implicit = half(dot(Z, dxy) - 1.0);"); in emitCode()
575 fragBuilder->codeAppend("half grad_dot = half(4.0 * dot(Z, Z));"); in emitCode()
[all …]
/third_party/skia/src/gpu/effects/
DGrDistanceFieldGeoProc.cpp111 fragBuilder->codeAppend("half4 texColor;"); in onEmitCode()
115 fragBuilder->codeAppend("half distance = " in onEmitCode()
122 fragBuilder->codeAppend("half afwidth;"); in onEmitCode()
148 fragBuilder->codeAppend("afwidth = abs(" SK_DistanceFieldAAFactor "*st_grad_len);"); in onEmitCode()
153 fragBuilder->codeAppend("half2 dist_grad = half2(float2(dFdx(distance), " in onEmitCode()
157 fragBuilder->codeAppend("half dg_len2 = dot(dist_grad, dist_grad);"); in onEmitCode()
158 fragBuilder->codeAppend("if (dg_len2 < 0.0001) {"); in onEmitCode()
159 fragBuilder->codeAppend("dist_grad = half2(0.7071, 0.7071);"); in onEmitCode()
160 fragBuilder->codeAppend("} else {"); in onEmitCode()
161 fragBuilder->codeAppend("dist_grad = dist_grad*half(inversesqrt(dg_len2));"); in onEmitCode()
[all …]
DGrShadowGeoProc.cpp31 fragBuilder->codeAppend("half3 shadowParams;"); in onEmitCode()
43 fragBuilder->codeAppend("half d = length(shadowParams.xy);"); in onEmitCode()
44 fragBuilder->codeAppend("float2 uv = float2(shadowParams.z * (1.0 - d), 0.5);"); in onEmitCode()
45 fragBuilder->codeAppend("half factor = "); in onEmitCode()
47 fragBuilder->codeAppend(".a;"); in onEmitCode()
DGrBicubicEffect.cpp45 fragBuilder->codeAppend("half2 f = half2(fract(coord));"); in emitCode()
46 fragBuilder->codeAppend("coord += 0.5 - f;"); in emitCode()
51 fragBuilder->codeAppend("half4 rowColors[4];"); in emitCode()
65 fragBuilder->codeAppend( in emitCode()
70 fragBuilder->codeAppend("half f = half(fract(coord));"); in emitCode()
71 fragBuilder->codeAppend("coord += 0.5 - f;"); in emitCode()
72 fragBuilder->codeAppend("half f2 = f * f;"); in emitCode()
74 fragBuilder->codeAppend("half4 c[4];"); in emitCode()
85 fragBuilder->codeAppend( in emitCode()
92 fragBuilder->codeAppend("bicubicColor = saturate(bicubicColor);"); in emitCode()
[all …]
DGrTextureEffect.cpp460 fb->codeAppend("{"); in emitCode()
466 fb->codeAppend("float m = mod(d, w2);"); in emitCode()
467 fb->codeAppend("float o = mix(m, w2 - m, step(w, m));"); in emitCode()
474 fb->codeAppend("float hw = w/2;"); in emitCode()
475 fb->codeAppend("float n = mod(d - hw, w2);"); in emitCode()
478 fb->codeAppend("}"); in emitCode()
481 fb->codeAppend("{"); in emitCode()
489 fb->codeAppend("}"); in emitCode()
519 fb->codeAppend("float2 extraRepeatCoord;"); in emitCode()
522 fb->codeAppend("half repeatCoordWeightX;"); in emitCode()
[all …]
DGrRRectEffect.cpp200 fragBuilder->codeAppend("float2 dxy = max(max(dxy0, dxy1), 0.0);"); in emitCode()
248 fragBuilder->codeAppend("float2 dxy = max(float2(dxy0.x, max(dxy0.y, dy1)), 0.0);"); in emitCode()
257 fragBuilder->codeAppend("float2 dxy = max(float2(max(dxy0.x, dx1), dxy0.y), 0.0);"); in emitCode()
266 fragBuilder->codeAppend("float2 dxy = max(float2(dxy1.x, max(dy0, dxy1.y)), 0.0);"); in emitCode()
275 fragBuilder->codeAppend("float2 dxy = max(float2(max(dx0, dxy1.x), dxy1.y), 0.0);"); in emitCode()
284 fragBuilder->codeAppend("alpha = 1.0 - alpha;"); in emitCode()
552 fragBuilder->codeAppend("float2 dxy = max(max(dxy0, dxy1), 0.0);"); in emitCode()
571 fragBuilder->codeAppend("float2 dxy = max(max(dxy0, dxy1), 0.0);"); in emitCode()
584 fragBuilder->codeAppend("half implicit = half(dot(Z, dxy) - 1.0);"); in emitCode()
586 fragBuilder->codeAppend("half grad_dot = half(4.0 * dot(Z, Z));"); in emitCode()
[all …]
/third_party/skia/src/gpu/tessellate/shaders/
DGrStrokeTessellationShader_InstancedImpl.cpp67 args.fVertBuilder->codeAppend(R"( in onEmitCode()
98 args.fVertBuilder->codeAppend(R"( in onEmitCode()
110 args.fVertBuilder->codeAppend(R"( in onEmitCode()
118 args.fVertBuilder->codeAppend(R"( in onEmitCode()
144 args.fVertBuilder->codeAppend(R"( in onEmitCode()
153 args.fVertBuilder->codeAppend(R"( in onEmitCode()
166 args.fVertBuilder->codeAppend(R"( in onEmitCode()
175 args.fVertBuilder->codeAppend(R"( in onEmitCode()
188 args.fVertBuilder->codeAppend(R"( in onEmitCode()
/third_party/flutter/skia/src/gpu/glsl/
DGrGLSLBlend.cpp27 fsBuilder->codeAppend("} else {"); in hard_light()
31 fsBuilder->codeAppend("}"); in hard_light()
52 fsBuilder->codeAppend("} else {"); in color_dodge_component()
54 fsBuilder->codeAppend("if (0.0 == d) {"); in color_dodge_component()
58 fsBuilder->codeAppend("} else {"); in color_dodge_component()
63 fsBuilder->codeAppend("}"); in color_dodge_component()
64 fsBuilder->codeAppend("}"); in color_dodge_component()
86 fsBuilder->codeAppend("} else {"); in color_burn_component()
91 fsBuilder->codeAppend("}"); in color_burn_component()
398 fsBuilder->codeAppend(" + "); in append_porterduff_term()
[all …]
DGrGLSLGeometryProcessor.cpp38 vBuilder->codeAppend(", 0"); // fallthru. in emitCode()
40 vBuilder->codeAppend(", 0"); // fallthru. in emitCode()
42 vBuilder->codeAppend(", 1"); // fallthru. in emitCode()
44 vBuilder->codeAppend(");"); in emitCode()
DGrGLSLShaderBuilder.h104 void codeAppend(const char* str) { this->code().append(str); } in codeAppend() function
106 void codeAppend(const char* str, size_t length) { this->code().append(str, length); } in codeAppend() function
145 fBuilder->codeAppend("{"); in ShaderBlock()
149 fBuilder->codeAppend("}"); in ~ShaderBlock()
/third_party/skia/src/gpu/glsl/
DGrGLSLShaderBuilder.h115 void codeAppend(const char* str) { this->code().append(str); } in codeAppend() function
117 void codeAppend(const char* str, size_t length) { this->code().append(str, length); } in codeAppend() function
119 void codeAppend(std::unique_ptr<SkSL::Statement> stmt);
171 fBuilder->codeAppend("{"); in ShaderBlock()
175 fBuilder->codeAppend("}"); in ~ShaderBlock()
/third_party/flutter/skia/src/effects/imagefilters/
DSkDisplacementMapEffect.cpp591 fragBuilder->codeAppend(";\n"); in emitCode()
603 fragBuilder->codeAppend("r"); in emitCode()
606 fragBuilder->codeAppend("g"); in emitCode()
609 fragBuilder->codeAppend("b"); in emitCode()
612 fragBuilder->codeAppend("a"); in emitCode()
620 fragBuilder->codeAppend("r"); in emitCode()
623 fragBuilder->codeAppend("g"); in emitCode()
626 fragBuilder->codeAppend("b"); in emitCode()
629 fragBuilder->codeAppend("a"); in emitCode()
634 fragBuilder->codeAppend("-half2(0.5));\t\t"); in emitCode()
[all …]

1234