/external/skia/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() 307 v->codeAppend ("float2 leftbloat = sign(corner - left);"); in onEmitCode() 308 v->codeAppend ("leftbloat = float2(0 != leftbloat.y ? leftbloat.y : leftbloat.x, " in onEmitCode() 311 v->codeAppend ("float2 rightbloat = sign(right - corner);"); in onEmitCode() 312 v->codeAppend ("rightbloat = float2(0 != rightbloat.y ? rightbloat.y : rightbloat.x, " in onEmitCode() 315 v->codeAppend ("bool2 left_right_notequal = notEqual(leftbloat, rightbloat);"); in onEmitCode() 317 v->codeAppend ("float2 bloatdir = leftbloat;"); in onEmitCode() 319 v->codeAppend ("float2 leftdir = corner - left;"); in onEmitCode() 320 v->codeAppend ("leftdir = (float2(0) != leftdir) ? normalize(leftdir) : float2(1, 0);"); in onEmitCode() 322 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() 84 s->codeAppend ("float nwidth = (abs(n.x) + abs(n.y)) * (bloat * 2);"); in EmitEdgeDistanceEquation() 87 s->codeAppend ("n /= (0 != nwidth) ? nwidth : 1;"); in EmitEdgeDistanceEquation() 119 s->codeAppend ("float nwidth = abs(n.x) + abs(n.y);"); in CalcEdgeCoverageAtBloatVertex() 136 s->codeAppend ("float nwidth = abs(n.x) + abs(n.y);"); in CalcEdgeCoveragesAtBloatVertices() 161 s->codeAppend ("half axis_alignedness = " in CalcCornerAttenuation() 168 s->codeAppend ("ninety_degreesness = ninety_degreesness * ninety_degreesness;"); in CalcCornerAttenuation()
|
D | GrCCPathProcessor.cpp | 181 v->codeAppend ("float2 refpt = (0 == sk_VertexID >> 2)" in onEmitCode() 192 v->codeAppend ("float2 K = float2(dot(N[0], refpt), dot(N[1], refpt45));"); in onEmitCode() 201 v->codeAppend ("half2 bloatdir = (0 != N[0].x) " in onEmitCode() 204 v->codeAppend ("octocoord = (ceil(octocoord * bloatdir - 1e-4) + 0.25) * bloatdir;"); in onEmitCode() 229 f->codeAppend ("half coverage = "); in onEmitCode() 232 f->codeAppend (".a;"); in onEmitCode() 240 f->codeAppend ("coverage = 1 - abs(fract(coverage) * 2 - 1);"); in onEmitCode()
|
/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/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/ops/ |
D | GrAAFillRRectOp.cpp | 327 v->codeAppend("float2 corner = corner_and_radius_outsets.xy;"); in onEmitCode() 328 v->codeAppend("float2 radius_outset = corner_and_radius_outsets.zw;"); in onEmitCode() 329 v->codeAppend("float2 aa_bloat_direction = aa_bloat_and_coverage.xy;"); in onEmitCode() 330 v->codeAppend("float coverage = aa_bloat_and_coverage.z;"); in onEmitCode() 331 v->codeAppend("float is_linear_coverage = aa_bloat_and_coverage.w;"); in onEmitCode() 334 v->codeAppend("float2 pixellength = inversesqrt(" in onEmitCode() 336 v->codeAppend("float4 normalized_axis_dirs = skew * pixellength.xyxy;"); in onEmitCode() 337 v->codeAppend("float2 axiswidths = (abs(normalized_axis_dirs.xy) + " in onEmitCode() 339 v->codeAppend("float2 aa_bloatradius = axiswidths * pixellength * .5;"); in onEmitCode() 342 v->codeAppend("float4 radii_and_neighbors = radii_selector" in onEmitCode() [all …]
|
/external/skia/src/gpu/effects/ |
D | GrDistanceFieldGeoProc.cpp | 86 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 …]
|
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() 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()
|
/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()
|
/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 …]
|
/external/skia/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 …]
|