/third_party/flutter/skia/src/effects/ |
D | SkHighContrastFilter.cpp | 248 fragBuilder->codeAppendf("half4 color = %s;", args.fInputColor); in emitCode() 251 fragBuilder->codeAppendf("half nonZeroAlpha = max(color.a, 0.0001);"); in emitCode() 252 fragBuilder->codeAppendf("color = half4(color.rgb / nonZeroAlpha, nonZeroAlpha);"); in emitCode() 260 fragBuilder->codeAppendf("half luma = dot(color, half4(%f, %f, %f, 0));", in emitCode() 262 fragBuilder->codeAppendf("color = half4(luma, luma, luma, 0);"); in emitCode() 266 fragBuilder->codeAppendf("color = half4(1, 1, 1, 1) - color;"); in emitCode() 271 fragBuilder->codeAppendf("half fmax = max(color.r, max(color.g, color.b));"); in emitCode() 272 fragBuilder->codeAppendf("half fmin = min(color.r, min(color.g, color.b));"); in emitCode() 273 fragBuilder->codeAppendf("half l = (fmax + fmin) / 2;"); in emitCode() 275 fragBuilder->codeAppendf("half h;"); in emitCode() [all …]
|
/third_party/flutter/skia/src/gpu/glsl/ |
D | GrGLSLBlend.cpp | 24 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 …]
|
D | GrGLSLXferProcessor.cpp | 24 fragBuilder->codeAppendf("%s.a = max(max(%s.r, %s.g), %s.b);", in adjust_for_lcd_coverage() 54 fragBuilder->codeAppendf("if (all(lessThanEqual(%s.rgb, half3(0)))) {" in emitCode() 72 fragBuilder->codeAppendf("half2 _dstTexCoord = (half2(sk_FragCoord.xy) - %s) * %s;", in emitCode() 79 fragBuilder->codeAppendf("half4 %s = ", dstColor); in emitCode() 91 fragBuilder->codeAppendf("half4 %s;", outColor); in emitCode() 103 fragBuilder->codeAppendf("%s = %s;", args.fOutputPrimary, outColor); in emitCode() 116 x->codeAppendf("%s = %s.%s;", outColor, outColor, swizzle.c_str()); in emitOutputSwizzle() 118 x->codeAppendf("%s = %s.%s;", outColorSecondary, outColorSecondary, swizzle.c_str()); in emitOutputSwizzle() 152 fragBuilder->codeAppendf("%s *= %s;", outColor, srcCoverage); in DefaultCoverageModulation() 153 fragBuilder->codeAppendf("%s = %s;", outColorSecondary, srcCoverage); in DefaultCoverageModulation() [all …]
|
D | GrGLSLFragmentShaderBuilder.cpp | 82 this->codeAppendf("\tfloat2 %s = %s.xy / %s.z;", coords2D.c_str(), coords.c_str(), in ensureCoords2D() 111 this->codeAppendf("gl_SampleMask[0] = (%s);", mask); in maskOffMultisampleCoverage() 116 this->codeAppendf("gl_SampleMask[0] &= (%s);", mask); in maskOffMultisampleCoverage() 128 this->codeAppendf("{"); in applyFnToMultisampleMask() 136 this->codeAppendf("float2 grad = float2(dFdx(%s), dFdy(%s));", fn, fn); in applyFnToMultisampleMask() 137 this->codeAppendf("float fnwidth = fwidth(%s);", fn); in applyFnToMultisampleMask() 140 this->codeAppendf("float fnwidth = abs(%s.x) + abs(%s.y);", grad, grad); in applyFnToMultisampleMask() 143 this->codeAppendf("int mask = 0;"); in applyFnToMultisampleMask() 144 this->codeAppendf("if (%s*2 < fnwidth) {", fn); // Are ANY samples inside the implicit fn? in applyFnToMultisampleMask() 145 this->codeAppendf( "if (%s*-2 >= fnwidth) {", fn); // Are ALL samples inside the implicit? in applyFnToMultisampleMask() [all …]
|
/third_party/flutter/skia/src/gpu/ccpr/ |
D | GrGSCoverageProcessor.cpp | 46 f->codeAppendf("half coverage;"); in onEmitCode() 48 f->codeAppendf("%s = half4(coverage);", args.fOutputColor); in onEmitCode() 49 f->codeAppendf("%s = half4(1);", args.fOutputCoverage); in onEmitCode() 60 g->codeAppendf("float%ix2 pts = transpose(float2x%i(sk_in[0].%s, sk_in[1].%s));", in emitGeometryShader() 69 g->codeAppendf("%s *= half(sk_in[0].sk_Position.w);", wind.c_str()); in emitGeometryShader() 121 g->codeAppendf("float2 p0 = pts[0], p1 = pts[%i];", numInputPoints - 1); in emitGeometryShader() 122 g->codeAppendf("float2 n = float2(p0.y - p1.y, p1.x - p0.x);"); in emitGeometryShader() 127 g->codeAppendf("%s = float3(-n, dot(n, p0) - .5*sign(%s));", in emitGeometryShader() 168 g->codeAppendf("int i = (%s > 0 ? sk_InvocationID : 4 - sk_InvocationID) %% 3;", in onEmitGeometryShader() 171 g->codeAppendf("float2 right = pts[(i + (%s > 0 ? 1 : 2)) %% 3];", wind.c_str()); in onEmitGeometryShader() [all …]
|
D | GrCCCoverageProcessor.cpp | 39 f->codeAppendf("%s = %s;", outputCoverage, fCoverages.fsIn()); in emitFragmentCoverageCode() 41 f->codeAppendf("%s = %s.z * %s.y + %s.x;", in emitFragmentCoverageCode() 55 s->codeAppendf("float2 a = %s[0] - %s[1], " in CalcWind() 60 s->codeAppendf("float2 p12 = (%s[1] + %s[2]) * .5;", pts, pts); in CalcWind() 61 s->codeAppendf("float2 a = %s[0] - p12, " in CalcWind() 73 s->codeAppendf("%s = (abs(area_x2 * 1024) > basewidth) ? sign(half(area_x2)) : 0;", in CalcWind() 78 s->codeAppendf("%s = sign(half(area_x2));", outputWind); in CalcWind() 108 s->codeAppendf("float2 n = float2(%s.y - %s.y, %s.x - %s.x);", in CalcEdgeCoverageAtBloatVertex() 111 s->codeAppendf("float t = dot(%s, n);", rasterVertexDir); in CalcEdgeCoverageAtBloatVertex() 114 s->codeAppendf("%s = half(abs(t) != nwidth ? t / nwidth : sign(t)) * -.5 - .5;", in CalcEdgeCoverageAtBloatVertex() [all …]
|
D | GrCCConicShader.cpp | 18 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() 31 s->codeAppendf("float kwidth = 2*bloat * (abs(%s[0].x) + abs(%s[0].y)) * sign(%s[0].z);", in emitSetupCode() 33 s->codeAppendf("%s *= 1/kwidth;", fKLMMatrix.c_str()); in emitSetupCode() 39 s->codeAppendf("float2 p1w = %s[1]*w;", pts); in emitSetupCode() 42 s->codeAppendf("conic_hull[0] = %s[0];", pts); in emitSetupCode() 43 s->codeAppendf("conic_hull[1] = (%s[0] + p1w) * r;", pts); in emitSetupCode() [all …]
|
D | GrCCPathProcessor.cpp | 175 v->codeAppendf("float wind = sign(devbounds.z - devbounds.x);"); in onEmitCode() 178 v->codeAppendf("float2 refpt = mix(devbounds.xy, devbounds.zw, corners.xy);"); in onEmitCode() 181 v->codeAppendf("float2 refpt45 = mix(devbounds45.xy, devbounds45.zw, corners.zw);"); in onEmitCode() 183 v->codeAppendf("refpt45 *= float2x2(+1, +1, -wind, +wind) * .5;"); in onEmitCode() 186 v->codeAppendf("float2x2 N = float2x2(" in onEmitCode() 189 v->codeAppendf("N = float2x2(wind, 0, 0, 1) * N;"); in onEmitCode() 190 v->codeAppendf("float2 K = float2(dot(N[0], refpt), dot(N[1], refpt45));"); in onEmitCode() 191 v->codeAppendf("float2 octocoord = K * inverse(N);"); in onEmitCode() 199 v->codeAppendf("float2 bloatdir = (0 != N[0].x) " in onEmitCode() 202 v->codeAppendf("octocoord = (ceil(octocoord * bloatdir - 1e-4) + 0.25) * bloatdir;"); in onEmitCode() [all …]
|
D | GrCCQuadraticShader.cpp | 16 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() 27 s->codeAppendf("quadratic_hull[0] = %s[0];", pts); in emitSetupCode() 28 s->codeAppendf("quadratic_hull[1] = (%s[0] + %s[1]) * .5;", pts, pts); in emitSetupCode() 29 s->codeAppendf("quadratic_hull[2] = (%s[1] + %s[2]) * .5;", pts, pts); in emitSetupCode() 30 s->codeAppendf("quadratic_hull[3] = %s[2];", pts); in emitSetupCode() 68 f->codeAppendf("%s *= half(%s.y);", outputCoverage, fEdge_fWind_fCorner.fsIn()); // Wind. in emitFragmentCoverageCode() 71 f->codeAppendf("%s = half(%s.z * %s.w) + %s;", // Attenuated corner coverage. in emitFragmentCoverageCode() 91 f->codeAppendf("float x = %s.x, y = %s.y;", fCoord_fGrad.fsIn(), fCoord_fGrad.fsIn()); in emitSampleMaskCode() 92 f->codeAppendf("float f = x*x - y;"); in emitSampleMaskCode() [all …]
|
D | GrCCCubicShader.cpp | 19 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() 130 f->codeAppendf("%s *= wind;", outputCoverage); in emitFragmentCoverageCode() 133 f->codeAppendf("%s = %s.x * %s.y + %s;", // Attenuated corner coverage. in emitFragmentCoverageCode() 153 f->codeAppendf("float k = %s.x, l = %s.y, m = %s.z;", in emitSampleMaskCode() 155 f->codeAppendf("float f = k*k*k - l*m;"); in emitSampleMaskCode() 156 f->codeAppendf("float2x2 grad_matrix = float2x2(%s);", fGradMatrix.fsIn()); in emitSampleMaskCode() [all …]
|
D | GrVSCoverageProcessor.cpp | 260 v->codeAppendf("float%ix2 pts = transpose(float2x%i(%s.%s, %s.%s));", inputWidth, inputWidth, in onEmitCode() 270 v->codeAppendf("wind *= half(%s.w);", in onEmitCode() 286 v->codeAppendf("int clockwise_indices = wind > 0 ? %s : 0x%x - %s;", in onEmitCode() 300 v->codeAppendf("float2 corner = %s[clockwise_indices & 3];", hullPts); in onEmitCode() 301 v->codeAppendf("float2 left = %s[clockwise_indices >> %i];", in onEmitCode() 303 v->codeAppendf("float2 right = %s[(clockwise_indices >> %i) & 3];", in onEmitCode() 324 v->codeAppendf("if (0 != (%s & %i)) {", // Are we a corner? in onEmitCode() 336 v->codeAppendf( "left_right_notequal = bool2(true);"); in onEmitCode() 344 v->codeAppendf("int bloatidx = (%s >> %i) & 3;", proc.fPerVertexData.name(), in onEmitCode() 352 v->codeAppendf( "if (all(left_right_notequal)) {"); in onEmitCode() [all …]
|
/third_party/flutter/skia/gm/ |
D | samplelocations.cpp | 131 v->codeAppendf("int x = sk_InstanceID %% 200;"); in onEmitCode() 132 v->codeAppendf("int y = sk_InstanceID / 200;"); in onEmitCode() 137 v->codeAppendf("int ileft = (sk_InstanceID*929) %% 17;"); in onEmitCode() 138 v->codeAppendf("int iright = ileft + 1 + ((sk_InstanceID*1637) %% (17 - ileft));"); in onEmitCode() 139 v->codeAppendf("int itop = (sk_InstanceID*313) %% 17;"); in onEmitCode() 140 v->codeAppendf("int ibot = itop + 1 + ((sk_InstanceID*1901) %% (17 - itop));"); in onEmitCode() 145 v->codeAppendf("float outset = 1/32.0;"); in onEmitCode() 146 v->codeAppendf("outset = (0 == (x + y) %% 2) ? -outset : +outset;"); in onEmitCode() 147 v->codeAppendf("float l = ileft/16.0 - outset;"); in onEmitCode() 148 v->codeAppendf("float r = iright/16.0 + outset;"); in onEmitCode() [all …]
|
D | fwidth_squircle.cpp | 97 v->codeAppendf("float2x2 R = float2x2(cos(.05), sin(.05), -sin(.05), cos(.05));"); in onEmitCode() 99 v->codeAppendf("%s = bboxcoord * 1.25;", squircleCoord.vsOut()); in onEmitCode() 100 v->codeAppendf("float3 vertexpos = float3(bboxcoord * 100 * R + 100, 1);"); in onEmitCode() 101 v->codeAppendf("vertexpos = %s * vertexpos;", uniforms->getUniformCStr(fViewMatrixHandle)); in onEmitCode() 105 f->codeAppendf("float golden_ratio = 1.61803398875;"); in onEmitCode() 106 f->codeAppendf("float pi = 3.141592653589793;"); in onEmitCode() 107 f->codeAppendf("float x = abs(%s.x), y = abs(%s.y);", in onEmitCode() 111 f->codeAppendf("float fn = half(pow(x, golden_ratio*pi) + pow(y, golden_ratio*pi) - 1);"); in onEmitCode() 112 f->codeAppendf("float fnwidth = fwidth(fn);"); in onEmitCode() 113 f->codeAppendf("fnwidth += 1e-10;"); // Guard against divide-by-zero. in onEmitCode() [all …]
|
/third_party/flutter/skia/src/gpu/effects/ |
D | GrBezierEffect.cpp | 80 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 …]
|
D | GrRRectEffect.cpp | 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() 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 …]
|
D | GrDistanceFieldGeoProc.cpp | 85 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() 386 fragBuilder->codeAppendf("float2 uv = %s;", uv.fsIn()); in onEmitCode() [all …]
|
D | GrAtlasedShaderHelpers.h | 29 args.fVertBuilder->codeAppendf("int2 signedCoords = int2(%s.x, %s.y);", in append_index_uv_varyings() 39 args.fVertBuilder->codeAppendf("float2 indexTexCoords = float2(%s.x, %s.y);", in append_index_uv_varyings() 55 args.fVertBuilder->codeAppendf("%s = unormTexCoords * %s;", uv->vsOut(), atlasSizeInvName); in append_index_uv_varyings() 60 args.fVertBuilder->codeAppendf("%s = texIdx;", texIdx->vsOut()); in append_index_uv_varyings() 64 args.fVertBuilder->codeAppendf("%s = unormTexCoords;", st->vsOut()); in append_index_uv_varyings() 75 args.fFragBuilder->codeAppendf("if (%s == %d) { %s = ", texIdx.fsIn(), i, colorName); in append_multitexture_lookup() 80 args.fFragBuilder->codeAppendf("{ %s = ", colorName); in append_multitexture_lookup()
|
/third_party/skia/src/gpu/effects/ |
D | GrAtlasedShaderHelpers.h | 31 args.fVertBuilder->codeAppendf(R"code( in append_index_uv_varyings() 37 args.fVertBuilder->codeAppendf(R"code( in append_index_uv_varyings() 43 args.fVertBuilder->codeAppendf(R"code( in append_index_uv_varyings() 52 args.fVertBuilder->codeAppendf(R"code( in append_index_uv_varyings() 58 args.fVertBuilder->codeAppendf(R"code( in append_index_uv_varyings() 66 args.fVertBuilder->codeAppendf(R"code( in append_index_uv_varyings() 78 args.fVertBuilder->codeAppendf( in append_index_uv_varyings() 87 args.fVertBuilder->codeAppendf("%s = %s(texIdx);", texIdx->vsOut(), cast); in append_index_uv_varyings() 92 args.fVertBuilder->codeAppendf("%s = unormTexCoords;", st->vsOut()); in append_index_uv_varyings() 104 args.fFragBuilder->codeAppendf("%s = float4(1, 1, 1, 1);", colorName); in append_multitexture_lookup() [all …]
|
D | GrRRectEffect.cpp | 198 fragBuilder->codeAppendf("float2 dxy0 = %s.LT - sk_FragCoord.xy;", rectName); in emitCode() 199 fragBuilder->codeAppendf("float2 dxy1 = sk_FragCoord.xy - %s.RB;", rectName); in emitCode() 201 fragBuilder->codeAppendf("half alpha = half(%s);", clampedCircleDistance.c_str()); in emitCode() 204 fragBuilder->codeAppendf("float2 dxy = max(%s.LT - sk_FragCoord.xy, 0.0);", in emitCode() 206 fragBuilder->codeAppendf("half rightAlpha = half(saturate(%s.R - sk_FragCoord.x));", in emitCode() 208 fragBuilder->codeAppendf("half bottomAlpha = half(saturate(%s.B - sk_FragCoord.y));", in emitCode() 210 fragBuilder->codeAppendf("half alpha = bottomAlpha * rightAlpha * half(%s);", in emitCode() 214 fragBuilder->codeAppendf("float2 dxy = max(float2(sk_FragCoord.x - %s.R, " in emitCode() 217 fragBuilder->codeAppendf("half leftAlpha = half(saturate(sk_FragCoord.x - %s.L));", in emitCode() 219 fragBuilder->codeAppendf("half bottomAlpha = half(saturate(%s.B - sk_FragCoord.y));", in emitCode() [all …]
|
D | GrBezierEffect.cpp | 62 vertBuilder->codeAppendf("%s = %s;", v.vsOut(), gp.inConicCoeffs().name()); in onEmitCode() 66 fragBuilder->codeAppendf("half4 %s;", args.fOutputColor); in onEmitCode() 109 fragBuilder->codeAppendf("%s = dFdx(%s.xyz);", dklmdx.c_str(), v.fsIn()); in onEmitCode() 110 fragBuilder->codeAppendf("%s = dFdy(%s.xyz);", dklmdy.c_str(), v.fsIn()); in onEmitCode() 111 fragBuilder->codeAppendf("%s = 2.0 * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;", in onEmitCode() 116 fragBuilder->codeAppendf("%s = 2.0 * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;", in onEmitCode() 121 fragBuilder->codeAppendf("%s = float2(%s, %s);", gF.c_str(), dfdx.c_str(), in onEmitCode() 123 fragBuilder->codeAppendf("%s = sqrt(dot(%s, %s));", in onEmitCode() 125 fragBuilder->codeAppendf("%s = %s.x*%s.x - %s.y*%s.z;", in onEmitCode() 127 fragBuilder->codeAppendf("%s = abs(%s);", func.c_str(), func.c_str()); in onEmitCode() [all …]
|
D | GrDistanceFieldGeoProc.cpp | 79 fragBuilder->codeAppendf("half4 %s;\n", args.fOutputColor); in onEmitCode() 110 fragBuilder->codeAppendf("float2 uv = %s;\n", uv.fsIn()); in onEmitCode() 119 fragBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName); in onEmitCode() 130 fragBuilder->codeAppendf( in onEmitCode() 133 fragBuilder->codeAppendf( in onEmitCode() 144 fragBuilder->codeAppendf("half st_grad_len = length(half2(dFdy(%s)));", st.fsIn()); in onEmitCode() 146 fragBuilder->codeAppendf("half st_grad_len = length(half2(dFdx(%s)));", st.fsIn()); in onEmitCode() 164 fragBuilder->codeAppendf("half2 Jdx = half2(dFdx(%s));", st.fsIn()); in onEmitCode() 165 fragBuilder->codeAppendf("half2 Jdy = half2(dFdy(%s));", st.fsIn()); in onEmitCode() 185 fragBuilder->codeAppendf("half4 %s = half4(val);", args.fOutputCoverage); in onEmitCode() [all …]
|
D | GrTextureEffect.cpp | 317 fb->codeAppendf("return "); in emitCode() 319 fb->codeAppendf(";"); in emitCode() 340 fb->codeAppendf("float2 inCoord = %s;", args.fSampleCoord); in emitCode() 437 fb->codeAppendf("subsetCoord.%s = inCoord.%s;", coordSwizzle, coordSwizzle); in emitCode() 441 fb->codeAppendf( in emitCode() 461 fb->codeAppendf("float w = %s.%s - %s.%s;", subsetName, subsetStopSwizzle, in emitCode() 463 fb->codeAppendf("float w2 = 2 * w;"); in emitCode() 464 fb->codeAppendf("float d = inCoord.%s - %s.%s;", coordSwizzle, subsetName, in emitCode() 468 fb->codeAppendf("subsetCoord.%s = o + %s.%s;", coordSwizzle, subsetName, in emitCode() 470 fb->codeAppendf("%s = w - o + %s.%s;", extraCoord, subsetName, in emitCode() [all …]
|
/third_party/flutter/skia/src/gpu/ops/ |
D | GrFillRRectOp.cpp | 463 v->codeAppendf( "%s.xy = float2(0, coverage);", arcCoord.vsOut()); in onEmitCode() 471 v->codeAppendf( "%s.xy = float2(arccoord.x+1, arccoord.y);", arcCoord.vsOut()); in onEmitCode() 474 v->codeAppendf("float2x2 derivatives = inverse(skewmatrix);"); in onEmitCode() 475 v->codeAppendf("%s.zw = derivatives * (arccoord/radii * 2);", arcCoord.vsOut()); in onEmitCode() 482 f->codeAppendf("float x_plus_1=%s.x, y=%s.y;", arcCoord.fsIn(), arcCoord.fsIn()); in onEmitCode() 483 f->codeAppendf("half coverage;"); in onEmitCode() 484 f->codeAppendf("if (0 == x_plus_1) {"); in onEmitCode() 485 f->codeAppendf( "coverage = half(y);"); // We are a non-arc pixel (linear coverage). in onEmitCode() 486 f->codeAppendf("} else {"); in onEmitCode() 487 f->codeAppendf( "float fn = x_plus_1 * (x_plus_1 - 2);"); // fn = (x+1)*(x-1) = x^2-1 in onEmitCode() [all …]
|
/third_party/skia/gm/ |
D | fwidth_squircle.cpp | 116 v->codeAppendf("float2x2 R = float2x2(cos(.05), sin(.05), -sin(.05), cos(.05));"); in makeProgramImpl() 118 v->codeAppendf("%s = bboxcoord * 1.25;", squircleCoord.vsOut()); in makeProgramImpl() 119 v->codeAppendf("float3 vertexpos = float3(bboxcoord * 100 * R + 100, 1);"); in makeProgramImpl() 120 v->codeAppendf("vertexpos = %s * vertexpos;", in makeProgramImpl() 125 f->codeAppendf("float golden_ratio = 1.61803398875;"); in makeProgramImpl() 126 f->codeAppendf("float pi = 3.141592653589793;"); in makeProgramImpl() 127 f->codeAppendf("float x = abs(%s.x), y = abs(%s.y);", in makeProgramImpl() 131 f->codeAppendf("float fn = half(pow(x, golden_ratio*pi) + " in makeProgramImpl() 133 f->codeAppendf("float fnwidth = fwidth(fn);"); in makeProgramImpl() 134 f->codeAppendf("fnwidth += 1e-10;"); // Guard against divide-by-zero. in makeProgramImpl() [all …]
|
/third_party/skia/src/gpu/ops/ |
D | AtlasInstancedHelper.cpp | 52 args.fVertBuilder->codeAppendf(R"( in injectShaderCode() 69 args.fVertBuilder->codeAppendf(R"( in injectShaderCode() 74 args.fFragBuilder->codeAppendf(R"( in injectShaderCode() 82 args.fFragBuilder->codeAppendf(R"(.a; in injectShaderCode() 85 args.fFragBuilder->codeAppendf("half atlasCoverage = "); in injectShaderCode() 87 args.fFragBuilder->codeAppendf(".a;"); in injectShaderCode() 91 args.fFragBuilder->codeAppendf("%s *= (1 - atlasCoverage);", args.fOutputCoverage); in injectShaderCode() 93 args.fFragBuilder->codeAppendf("%s *= atlasCoverage;", args.fOutputCoverage); in injectShaderCode()
|