/external/skqp/src/gpu/ccpr/ |
D | GrCCCubicShader.cpp | 25 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 …]
|
D | GrCCCoverageProcessor_VSImpl.cpp | 265 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 …]
|
D | GrCCCoverageProcessor_GSImpl.cpp | 143 g->codeAppend ("float2 top = pts[i];"); in onEmitGeometryShader() 148 g->codeAppend ("float2 leftbloat = sign(top - left);"); in onEmitGeometryShader() 149 g->codeAppend ("leftbloat = float2(0 != leftbloat.y ? leftbloat.y : leftbloat.x, " in onEmitGeometryShader() 152 g->codeAppend ("float2 rightbloat = sign(right - top);"); in onEmitGeometryShader() 153 g->codeAppend ("rightbloat = float2(0 != rightbloat.y ? rightbloat.y : rightbloat.x, " in onEmitGeometryShader() 156 g->codeAppend ("float2 downbloat = sign(left - right);"); in onEmitGeometryShader() 157 g->codeAppend ("downbloat = float2(0 != downbloat.y ? downbloat.y : downbloat.x, " in onEmitGeometryShader() 161 g->codeAppend ("half4 coverages = half4(+1);"); in onEmitGeometryShader() 164 g->codeAppend ("if (sk_InvocationID >= 2) {"); // Are we an edge? in onEmitGeometryShader() 168 g->codeAppend ( "coverages.yzw = half3(-1, 0, -1 - coverages[0]);"); in onEmitGeometryShader() [all …]
|
D | GrCCClipProcessor.cpp | 54 f->codeAppend ("half coverage;"); in emitCode() 70 f->codeAppend ("half coverage_count = "); in emitCode() 72 f->codeAppend (".a;"); in emitCode() 76 f->codeAppend ("half t = mod(abs(coverage_count), 2);"); in emitCode() 77 f->codeAppend ("coverage = 1 - abs(t - 1);"); in emitCode() 79 f->codeAppend ("coverage = min(abs(coverage_count), 1);"); in emitCode() 83 f->codeAppend ("} else {"); in emitCode() 84 f->codeAppend ( "coverage = 0;"); in emitCode() 85 f->codeAppend ("}"); in emitCode() 89 f->codeAppend ("coverage = 1 - coverage;"); in emitCode()
|
D | GrCCStroker.cpp | 107 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 …]
|
D | GrCCCoverageProcessor.cpp | 61 s->codeAppend ("float area_x2 = determinant(float2x2(a, b));"); in CalcWind() 67 s->codeAppend ("float2 bbox_size = max(abs(a), abs(b));"); in CalcWind() 68 s->codeAppend ("float basewidth = max(bbox_size.x + bbox_size.y, 1);"); in CalcWind() 83 s->codeAppend ("float nwidth = (abs(n.x) + abs(n.y)) * (bloat * 2);"); in EmitEdgeDistanceEquation() 86 s->codeAppend ("n /= (0 != nwidth) ? nwidth : 1;"); in EmitEdgeDistanceEquation() 118 s->codeAppend ("float nwidth = abs(n.x) + abs(n.y);"); in CalcEdgeCoverageAtBloatVertex() 134 s->codeAppend ("float nwidth = abs(n.x) + abs(n.y);"); in CalcEdgeCoveragesAtBloatVertices() 158 s->codeAppend ("half axis_alignedness = " in CalcCornerAttenuation() 165 s->codeAppend ("ninety_degreesness = ninety_degreesness * ninety_degreesness;"); in CalcCornerAttenuation()
|
D | GrCCPathProcessor.cpp | 179 v->codeAppend ("float2 refpt = (0 == sk_VertexID >> 2)" in onEmitCode() 190 v->codeAppend ("float2 K = float2(dot(N[0], refpt), dot(N[1], refpt45));"); in onEmitCode() 199 v->codeAppend ("float2 bloatdir = (0 != N[0].x) " in onEmitCode() 201 v->codeAppend ("octocoord = (ceil(octocoord * bloatdir - 1e-4) + 0.25) * bloatdir;"); in onEmitCode() 226 f->codeAppend ("half coverage = "); in onEmitCode() 229 f->codeAppend (".a;"); in onEmitCode() 237 f->codeAppend ("coverage = 1 - abs(fract(coverage) * 2 - 1);"); in onEmitCode()
|
/external/skia/src/gpu/ops/ |
D | GrFillRRectOp.cpp | 513 v->codeAppend("float2 corner = corner_and_radius_outsets.xy;"); in onEmitCode() 514 v->codeAppend("float2 radius_outset = corner_and_radius_outsets.zw;"); in onEmitCode() 515 v->codeAppend("float2 aa_bloat_direction = aa_bloat_and_coverage.xy;"); in onEmitCode() 516 v->codeAppend("float is_linear_coverage = aa_bloat_and_coverage.w;"); in onEmitCode() 519 v->codeAppend("float2 pixellength = inversesqrt(" in onEmitCode() 521 v->codeAppend("float4 normalized_axis_dirs = skew * pixellength.xyxy;"); in onEmitCode() 522 v->codeAppend("float2 axiswidths = (abs(normalized_axis_dirs.xy) + " in onEmitCode() 524 v->codeAppend("float2 aa_bloatradius = axiswidths * pixellength * .5;"); in onEmitCode() 527 v->codeAppend("float4 radii_and_neighbors = radii_selector" in onEmitCode() 529 v->codeAppend("float2 radii = radii_and_neighbors.xy;"); in onEmitCode() [all …]
|
/external/skqp/src/gpu/ops/ |
D | GrAAFillRRectOp.cpp | 312 v->codeAppend("float2 corner = corner_and_radius_outsets.xy;"); in onEmitCode() 313 v->codeAppend("float2 radius_outset = corner_and_radius_outsets.zw;"); in onEmitCode() 314 v->codeAppend("float2 aa_bloat_direction = aa_bloat_and_coverage.xy;"); in onEmitCode() 315 v->codeAppend("float coverage = aa_bloat_and_coverage.z;"); in onEmitCode() 316 v->codeAppend("float is_linear_coverage = aa_bloat_and_coverage.w;"); in onEmitCode() 319 v->codeAppend("float2 pixellength = inversesqrt(" in onEmitCode() 321 v->codeAppend("float4 normalized_axis_dirs = skew * pixellength.xyxy;"); in onEmitCode() 322 v->codeAppend("float2 axiswidths = (abs(normalized_axis_dirs.xy) + " in onEmitCode() 324 v->codeAppend("float2 aa_bloatradius = axiswidths * pixellength * .5;"); in onEmitCode() 327 v->codeAppend("float4 radii_and_neighbors = radii_selector" in onEmitCode() [all …]
|
/external/skia/src/gpu/effects/ |
D | GrDistanceFieldGeoProc.cpp | 85 fragBuilder->codeAppend("half4 texColor;"); in onEmitCode() 89 fragBuilder->codeAppend("half distance = " in onEmitCode() 96 fragBuilder->codeAppend("half afwidth;"); in onEmitCode() 122 fragBuilder->codeAppend("afwidth = abs(" SK_DistanceFieldAAFactor "*st_grad_len);"); in onEmitCode() 127 fragBuilder->codeAppend("half2 dist_grad = half2(float2(dFdx(distance), " in onEmitCode() 131 fragBuilder->codeAppend("half dg_len2 = dot(dist_grad, dist_grad);"); in onEmitCode() 132 fragBuilder->codeAppend("if (dg_len2 < 0.0001) {"); in onEmitCode() 133 fragBuilder->codeAppend("dist_grad = half2(0.7071, 0.7071);"); in onEmitCode() 134 fragBuilder->codeAppend("} else {"); in onEmitCode() 135 fragBuilder->codeAppend("dist_grad = dist_grad*half(inversesqrt(dg_len2));"); in onEmitCode() [all …]
|
D | GrShadowGeoProc.cpp | 29 fragBuilder->codeAppend("half3 shadowParams;"); in onEmitCode() 40 fragBuilder->codeAppend("half d = length(shadowParams.xy);"); in onEmitCode() 41 fragBuilder->codeAppend("float2 uv = float2(shadowParams.z * (1.0 - d), 0.5);"); in onEmitCode() 42 fragBuilder->codeAppend("half factor = "); in onEmitCode() 44 fragBuilder->codeAppend(".a;"); in onEmitCode()
|
D | GrBicubicEffect.cpp | 48 fragBuilder->codeAppend("half2 f = half2(fract(coord));"); in emitCode() 49 fragBuilder->codeAppend("coord += 0.5 - f;"); in emitCode() 54 fragBuilder->codeAppend("half4 rowColors[4];"); in emitCode() 68 fragBuilder->codeAppend( in emitCode() 73 fragBuilder->codeAppend("half f = half(fract(coord));"); in emitCode() 74 fragBuilder->codeAppend("coord += 0.5 - f;"); in emitCode() 75 fragBuilder->codeAppend("half f2 = f * f;"); in emitCode() 77 fragBuilder->codeAppend("half4 c[4];"); in emitCode() 88 fragBuilder->codeAppend( in emitCode() 95 fragBuilder->codeAppend("bicubicColor = saturate(bicubicColor);"); in emitCode() [all …]
|
D | GrTextureEffect.cpp | 461 fb->codeAppend("{"); in emitCode() 467 fb->codeAppend("float m = mod(d, w2);"); in emitCode() 468 fb->codeAppend("float o = mix(m, w2 - m, step(w, m));"); in emitCode() 475 fb->codeAppend("float hw = w/2;"); in emitCode() 476 fb->codeAppend("float n = mod(d - hw, w2);"); in emitCode() 479 fb->codeAppend("}"); in emitCode() 482 fb->codeAppend("{"); in emitCode() 490 fb->codeAppend("}"); in emitCode() 520 fb->codeAppend("float2 extraRepeatCoord;"); in emitCode() 523 fb->codeAppend("half repeatCoordWeightX;"); in emitCode() [all …]
|
/external/skqp/src/gpu/effects/ |
D | GrDistanceFieldGeoProc.cpp | 87 fragBuilder->codeAppend("half4 texColor;"); in onEmitCode() 91 fragBuilder->codeAppend("half distance = " in onEmitCode() 98 fragBuilder->codeAppend("half afwidth;"); in onEmitCode() 126 fragBuilder->codeAppend("afwidth = abs(" SK_DistanceFieldAAFactor "*st_grad_len);"); in onEmitCode() 131 fragBuilder->codeAppend("half2 dist_grad = half2(dFdx(distance), dFdy(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*inversesqrt(dg_len2);"); in onEmitCode() [all …]
|
D | GrAtlasedShaderHelpers.h | 31 … args.fVertBuilder->codeAppend("int texIdx = 2*(signedCoords.x & 0x1) + (signedCoords.y & 0x1);"); in append_index_uv_varyings() 32 …args.fVertBuilder->codeAppend("float2 unormTexCoords = float2(signedCoords.x/2, signedCoords.y/2);… in append_index_uv_varyings() 36 args.fVertBuilder->codeAppend("float2 unormTexCoords = floor(0.5*indexTexCoords);"); in append_index_uv_varyings() 37 args.fVertBuilder->codeAppend("float2 diff = indexTexCoords - 2.0*unormTexCoords;"); in append_index_uv_varyings() 38 args.fVertBuilder->codeAppend("float texIdx = 2.0*diff.x + diff.y;"); in append_index_uv_varyings() 66 args.fFragBuilder->codeAppend("; } else "); in append_multitexture_lookup() 71 args.fFragBuilder->codeAppend("; }"); in append_multitexture_lookup()
|
D | GrShadowGeoProc.cpp | 29 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()
|
D | GrConvexPolyEffect.cpp | 50 fragBuilder->codeAppend("\t\thalf alpha = 1.0;\n"); in emitCode() 51 fragBuilder->codeAppend("\t\thalf edge;\n"); in emitCode() 57 fragBuilder->codeAppend("\t\tedge = saturate(edge);\n"); in emitCode() 59 fragBuilder->codeAppend("\t\tedge = edge >= 0.5 ? 1.0 : 0.0;\n"); in emitCode() 61 fragBuilder->codeAppend("\t\talpha *= edge;\n"); in emitCode() 65 fragBuilder->codeAppend("\talpha = 1.0 - alpha;\n"); in emitCode()
|
D | GrRRectEffect.cpp | 195 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("float implicit = dot(Z, dxy) - 1.0;"); in emitCode() 575 fragBuilder->codeAppend("float grad_dot = 4.0 * dot(Z, Z);"); in emitCode() [all …]
|
D | GrBicubicEffect.cpp | 67 fragBuilder->codeAppend("half4x4 kMitchellCoefficients = half4x4(" in emitCode() 78 fragBuilder->codeAppend("float2 f = fract(coord);"); in emitCode() 80 …fragBuilder->codeAppend("half4 wx = kMitchellCoefficients * half4(1.0, f.x, f.x * f.x, f.x * f.x *… in emitCode() 81 …fragBuilder->codeAppend("half4 wy = kMitchellCoefficients * half4(1.0, f.y, f.y * f.y, f.y * f.y *… in emitCode() 82 fragBuilder->codeAppend("half4 rowColors[4];"); in emitCode()
|
/external/skqp/src/gpu/glsl/ |
D | GrGLSLBlend.cpp | 27 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() 399 fsBuilder->codeAppend(" + "); in append_porterduff_term() [all …]
|
D | GrGLSLGeometryProcessor.cpp | 38 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()
|
/external/skia/src/gpu/tessellate/ |
D | GrStrokeTessellateShader.cpp | 181 v->codeAppend(R"( in onEmitCode() 190 v->codeAppend(R"( in onEmitCode() 196 v->codeAppend(R"( in onEmitCode() 199 v->codeAppend(R"( in onEmitCode() 203 v->codeAppend(R"( in onEmitCode() 380 v->codeAppend(R"( in onEmitCode() 384 v->codeAppend(R"( in onEmitCode() 1045 args.fVertBuilder->codeAppend(R"( in onEmitCode() 1070 args.fVertBuilder->codeAppend(R"( in onEmitCode() 1075 args.fVertBuilder->codeAppend(R"( in onEmitCode() [all …]
|
/external/skia/src/gpu/ccpr/ |
D | GrCCClipProcessor.cpp | 67 f->codeAppend("half coverage;"); in emitCode() 90 f->codeAppend("} else {"); in emitCode() 91 f->codeAppend( "coverage = 0;"); in emitCode() 92 f->codeAppend("}"); in emitCode() 96 f->codeAppend("coverage = 1 - coverage;"); in emitCode()
|
/external/skia/src/gpu/glsl/ |
D | GrGLSLXferProcessor.cpp | 73 fragBuilder->codeAppend("// Read color from copy of the destination.\n"); in emitCode() 78 fragBuilder->codeAppend("_dstTexCoord.y = 1.0 - _dstTexCoord.y;"); in emitCode() 83 fragBuilder->codeAppend(";"); in emitCode() 87 fragBuilder->codeAppend(";"); in emitCode()
|
D | GrGLSLShaderBuilder.h | 117 void codeAppend(const char* str) { this->code().append(str); } in codeAppend() function 119 void codeAppend(const char* str, size_t length) { this->code().append(str, length); } in codeAppend() function 121 void codeAppend(std::unique_ptr<SkSL::Statement> stmt); 171 fBuilder->codeAppend("{"); in ShaderBlock() 175 fBuilder->codeAppend("}"); in ~ShaderBlock()
|