/external/skqp/src/effects/ |
D | SkHighContrastFilter.cpp | 247 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/ |
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() 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/skqp/src/gpu/ccpr/ |
D | GrCCCoverageProcessor_GSImpl.cpp | 56 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 …]
|
D | GrCCCoverageProcessor.cpp | 37 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 …]
|
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() 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 …]
|
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() 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()
|
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() 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()
|
D | GrCCPathProcessor.cpp | 172 v->codeAppendf("float2x2 N = float2x2(%s.xy, %s.zw);", proc.getEdgeNormsAttrib().name(), in onEmitCode() 177 v->codeAppendf("float4 devbounds = %s;", in onEmitCode() 185 v->codeAppendf("float2 refpt45 = (0 == ((sk_VertexID + 1) & (1 << 2))) ? %s.xy : %s.zw;", in onEmitCode() 188 v->codeAppendf("refpt45 *= float2x2(.5,.5,-.5,.5);"); // transform back to device space. in onEmitCode() 191 v->codeAppendf("float2 octocoord = K * inverse(N);"); in onEmitCode() 206 v->codeAppendf("float2 atlascoord = octocoord + float2(%s);", in onEmitCode() 209 v->codeAppendf("%s.xy = atlascoord * %s;", texcoord.vsOut(), atlasAdjust); in onEmitCode() 212 v->codeAppendf("%s.xy = float2(atlascoord.x * %s.x, 1 - atlascoord.y * %s.y);", in onEmitCode() 217 v->codeAppendf("%s.z = sign(devbounds.z - devbounds.x) * .5;", texcoord.vsOut()); in onEmitCode() 233 f->codeAppendf("coverage = min(abs(coverage) * %s.z, .5);", texcoord.fsIn()); in onEmitCode() [all …]
|
/external/skqp/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 = %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 = %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 …]
|
D | GrAtlasedShaderHelpers.h | 29 args.fVertBuilder->codeAppendf("int2 signedCoords = int2(%s.x, %s.y);", in append_index_uv_varyings() 34 args.fVertBuilder->codeAppendf("float2 indexTexCoords = float2(%s.x, %s.y);", in append_index_uv_varyings() 43 args.fVertBuilder->codeAppendf("%s = unormTexCoords * %s;", uv->vsOut(), atlasSizeInvName); in append_index_uv_varyings() 48 args.fVertBuilder->codeAppendf("%s = texIdx;", texIdx->vsOut()); in append_index_uv_varyings() 52 args.fVertBuilder->codeAppendf("%s = unormTexCoords;", st->vsOut()); in append_index_uv_varyings() 63 args.fFragBuilder->codeAppendf("if (%s == %d) { %s = ", texIdx.fsIn(), i, colorName); in append_multitexture_lookup() 68 args.fFragBuilder->codeAppendf("{ %s = ", colorName); in append_multitexture_lookup()
|
D | GrDistanceFieldGeoProc.cpp | 86 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/skia/src/gpu/effects/ |
D | GrAtlasedShaderHelpers.h | 32 args.fVertBuilder->codeAppendf(R"code( in append_index_uv_varyings() 37 args.fVertBuilder->codeAppendf(R"code( in append_index_uv_varyings() 45 args.fVertBuilder->codeAppendf(R"code( in append_index_uv_varyings() 50 args.fVertBuilder->codeAppendf(R"code( in append_index_uv_varyings() 61 args.fVertBuilder->codeAppendf( in append_index_uv_varyings() 70 args.fVertBuilder->codeAppendf("%s = %s(texIdx);", texIdx->vsOut(), cast); in append_index_uv_varyings() 75 args.fVertBuilder->codeAppendf("%s = unormTexCoords;", st->vsOut()); in append_index_uv_varyings() 87 args.fFragBuilder->codeAppendf("%s = float4(1, 1, 1, 1);", colorName); in append_multitexture_lookup() 93 args.fFragBuilder->codeAppendf("if (%s == %d) { %s = ", texIdx.fsIn(), i, colorName); in append_multitexture_lookup() 97 args.fFragBuilder->codeAppendf("{ %s = ", colorName); in append_multitexture_lookup()
|
D | GrRRectEffect.cpp | 211 fragBuilder->codeAppendf("float2 dxy0 = %s.LT - sk_FragCoord.xy;", rectName); in emitCode() 212 fragBuilder->codeAppendf("float2 dxy1 = sk_FragCoord.xy - %s.RB;", rectName); in emitCode() 214 fragBuilder->codeAppendf("half alpha = half(%s);", clampedCircleDistance.c_str()); in emitCode() 217 fragBuilder->codeAppendf("float2 dxy = max(%s.LT - sk_FragCoord.xy, 0.0);", in emitCode() 219 fragBuilder->codeAppendf("half rightAlpha = half(saturate(%s.R - sk_FragCoord.x));", in emitCode() 221 fragBuilder->codeAppendf("half bottomAlpha = half(saturate(%s.B - sk_FragCoord.y));", in emitCode() 223 fragBuilder->codeAppendf("half alpha = bottomAlpha * rightAlpha * half(%s);", in emitCode() 227 fragBuilder->codeAppendf("float2 dxy = max(float2(sk_FragCoord.x - %s.R, " in emitCode() 230 fragBuilder->codeAppendf("half leftAlpha = half(saturate(sk_FragCoord.x - %s.L));", in emitCode() 232 fragBuilder->codeAppendf("half bottomAlpha = half(saturate(%s.B - sk_FragCoord.y));", in emitCode() [all …]
|
D | GrBezierEffect.cpp | 76 vertBuilder->codeAppendf("%s = %s;", v.vsOut(), gp.inConicCoeffs().name()); in onEmitCode() 80 fragBuilder->codeAppendf("half4 %s;", args.fOutputColor); in onEmitCode() 123 fragBuilder->codeAppendf("%s = dFdx(%s.xyz);", dklmdx.c_str(), v.fsIn()); in onEmitCode() 124 fragBuilder->codeAppendf("%s = dFdy(%s.xyz);", dklmdy.c_str(), v.fsIn()); in onEmitCode() 125 fragBuilder->codeAppendf("%s = 2.0 * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;", in onEmitCode() 130 fragBuilder->codeAppendf("%s = 2.0 * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;", in onEmitCode() 135 fragBuilder->codeAppendf("%s = float2(%s, %s);", gF.c_str(), dfdx.c_str(), in onEmitCode() 137 fragBuilder->codeAppendf("%s = sqrt(dot(%s, %s));", in onEmitCode() 139 fragBuilder->codeAppendf("%s = %s.x*%s.x - %s.y*%s.z;", in onEmitCode() 141 fragBuilder->codeAppendf("%s = abs(%s);", func.c_str(), func.c_str()); in onEmitCode() [all …]
|
D | GrDistanceFieldGeoProc.cpp | 56 fragBuilder->codeAppendf("half4 %s;\n", args.fOutputColor); in onEmitCode() 84 fragBuilder->codeAppendf("float2 uv = %s;\n", uv.fsIn()); in onEmitCode() 93 fragBuilder->codeAppendf("distance -= %s;", distanceAdjustUniName); in onEmitCode() 104 fragBuilder->codeAppendf( in onEmitCode() 107 fragBuilder->codeAppendf( in onEmitCode() 118 fragBuilder->codeAppendf("half st_grad_len = length(half2(dFdy(%s)));", st.fsIn()); in onEmitCode() 120 fragBuilder->codeAppendf("half st_grad_len = length(half2(dFdx(%s)));", st.fsIn()); in onEmitCode() 138 fragBuilder->codeAppendf("half2 Jdx = half2(dFdx(%s));", st.fsIn()); in onEmitCode() 139 fragBuilder->codeAppendf("half2 Jdy = half2(dFdy(%s));", st.fsIn()); in onEmitCode() 159 fragBuilder->codeAppendf("half4 %s = half4(val);", args.fOutputCoverage); in onEmitCode() [all …]
|
D | GrTextureEffect.cpp | 318 fb->codeAppendf("return "); in emitCode() 320 fb->codeAppendf(";"); in emitCode() 341 fb->codeAppendf("float2 inCoord = %s;", args.fSampleCoord); in emitCode() 438 fb->codeAppendf("subsetCoord.%s = inCoord.%s;", coordSwizzle, coordSwizzle); in emitCode() 442 fb->codeAppendf( in emitCode() 462 fb->codeAppendf("float w = %s.%s - %s.%s;", subsetName, subsetStopSwizzle, in emitCode() 464 fb->codeAppendf("float w2 = 2 * w;"); in emitCode() 465 fb->codeAppendf("float d = inCoord.%s - %s.%s;", coordSwizzle, subsetName, in emitCode() 469 fb->codeAppendf("subsetCoord.%s = o + %s.%s;", coordSwizzle, subsetName, in emitCode() 471 fb->codeAppendf("%s = w - o + %s.%s;", extraCoord, subsetName, in emitCode() [all …]
|
D | GrMatrixConvolutionEffect.cpp | 172 fragBuilder->codeAppendf("for (int i = 0; i < %d; ++i)", (int)kernelArea); in emitKernelBlock() 182 fragBuilder->codeAppendf("k = %s.w + %s;", kernelSample.c_str(), kernelBias); in emitKernelBlock() 183 fragBuilder->codeAppendf("sourceOffset.y = floor(half(i) / %d);", kernelWidth); in emitKernelBlock() 184 fragBuilder->codeAppendf("sourceOffset.x = half(i) - sourceOffset.y * %d;", kernelWidth); in emitKernelBlock() 186 fragBuilder->codeAppendf("sourceOffset = half2(%d, %d);", loc.x(), loc.y()); in emitKernelBlock() 189 fragBuilder->codeAppendf("k = %s[%d][%d];", kernel, offset / 4, offset & 0x3); in emitKernelBlock() 193 fragBuilder->codeAppendf("half4 c = %s;", sample.c_str()); in emitKernelBlock() 229 fragBuilder->codeAppendf("float2 coord = %s - %s;", args.fSampleCoord, kernelOffset); in emitCode() 241 fragBuilder->codeAppendf("half4 color;"); in emitCode() 243 fragBuilder->codeAppendf("color = sum * %s + %s;", gain, bias); in emitCode() [all …]
|
/external/skia/src/gpu/glsl/ |
D | GrGLSLXferProcessor.cpp | 24 fragBuilder->codeAppendf("%s.a = max(max(%s.r, %s.g), %s.b);", in adjust_for_lcd_coverage() 52 fragBuilder->codeAppendf("if (all(lessThanEqual(%s.rgb, half3(0)))) {" in emitCode() 74 fragBuilder->codeAppendf("half2 _dstTexCoord = (half2(sk_FragCoord.xy) - %s) * %s;", in emitCode() 81 fragBuilder->codeAppendf("half4 %s = ", dstColor); in emitCode() 85 fragBuilder->codeAppendf("half4 %s = ", dstColor); in emitCode() 97 fragBuilder->codeAppendf("half4 %s;", outColor); in emitCode() 109 fragBuilder->codeAppendf("%s = %s;", args.fOutputPrimary, outColor); in emitCode() 123 x->codeAppendf("%s = %s.%s;", outColor, outColor, swizzle.asString().c_str()); in emitWriteSwizzle() 125 x->codeAppendf("%s = %s.%s;", outColorSecondary, outColorSecondary, in emitWriteSwizzle() 156 fragBuilder->codeAppendf("half3 lerpRGB = mix(%s.aaa, %s.aaa, %s.rgb);", in DefaultCoverageModulation() [all …]
|
D | GrGLSLGeometryProcessor.cpp | 53 vBuilder->codeAppendf("sk_Position = float4(%s", gpArgs.fPositionVar.c_str()); in emitCode() 93 vb->codeAppendf("%s = %s;\n", baseLocalCoord.vsOut(), in collectTransforms() 230 vb->codeAppendf("%s = float3x2(%s) * %s", tr.fOutputCoords.getName().c_str(), in emitTransformCode() 234 vb->codeAppendf("%s = ((%s) * %s).xy", tr.fOutputCoords.getName().c_str(), in emitTransformCode() 240 vb->codeAppendf("%s = (%s) * %s", tr.fOutputCoords.getName().c_str(), in emitTransformCode() 262 fragBuilder->codeAppendf("%s = %s;", outputName, stagedLocalVarName); in setupUniformColor() 264 fragBuilder->codeAppendf("%s = max(%s, half4(0));", outputName, outputName); in setupUniformColor() 297 vertBuilder->codeAppendf("float%d %s = %s;", in write_passthrough_vertex_position() 332 vertBuilder->codeAppendf("float3 %s = %s.xz1 * %s + %s.yw0;\n", in write_vertex_position() 338 vertBuilder->codeAppendf("float3 %s = %s * %s;\n", in write_vertex_position() [all …]
|
/external/skqp/gm/ |
D | fwidth_squircle.cpp | 74 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 …]
|
/external/skia/gm/ |
D | fwidth_squircle.cpp | 105 v->codeAppendf("float2x2 R = float2x2(cos(.05), sin(.05), -sin(.05), cos(.05));"); in onEmitCode() 107 v->codeAppendf("%s = bboxcoord * 1.25;", squircleCoord.vsOut()); in onEmitCode() 108 v->codeAppendf("float3 vertexpos = float3(bboxcoord * 100 * R + 100, 1);"); in onEmitCode() 109 v->codeAppendf("vertexpos = %s * vertexpos;", uniforms->getUniformCStr(fViewMatrixHandle)); in onEmitCode() 113 f->codeAppendf("float golden_ratio = 1.61803398875;"); in onEmitCode() 114 f->codeAppendf("float pi = 3.141592653589793;"); in onEmitCode() 115 f->codeAppendf("float x = abs(%s.x), y = abs(%s.y);", in onEmitCode() 119 f->codeAppendf("float fn = half(pow(x, golden_ratio*pi) + pow(y, golden_ratio*pi) - 1);"); in onEmitCode() 120 f->codeAppendf("float fnwidth = fwidth(fn);"); in onEmitCode() 121 f->codeAppendf("fnwidth += 1e-10;"); // Guard against divide-by-zero. in onEmitCode() [all …]
|
/external/skqp/src/gpu/ops/ |
D | GrAAFillRRectOp.cpp | 386 v->codeAppendf( "%s.xy = float2(0, coverage);", arcCoord.vsOut()); in onEmitCode() 394 v->codeAppendf( "%s.xy = float2(arccoord.x+1, arccoord.y);", arcCoord.vsOut()); in onEmitCode() 397 v->codeAppendf("float2x2 derivatives = inverse(skewmatrix);"); in onEmitCode() 398 v->codeAppendf("%s.zw = derivatives * (arccoord/radii * 2);", arcCoord.vsOut()); in onEmitCode() 405 f->codeAppendf("float x_plus_1=%s.x, y=%s.y;", arcCoord.fsIn(), arcCoord.fsIn()); in onEmitCode() 406 f->codeAppendf("half coverage;"); in onEmitCode() 407 f->codeAppendf("if (0 == x_plus_1) {"); in onEmitCode() 408 f->codeAppendf( "coverage = y;"); // We are a non-arc pixel (i.e., linear coverage). in onEmitCode() 409 f->codeAppendf("} else {"); in onEmitCode() 410 f->codeAppendf( "float fn = x_plus_1 * (x_plus_1 - 2);"); // fn = (x+1)*(x-1) = x^2-1 in onEmitCode() [all …]
|
/external/skia/src/gpu/ops/ |
D | GrFillRRectOp.cpp | 498 f->codeAppendf("half4 %s;", args.fOutputColor); in onEmitCode() 505 v->codeAppendf("float aa_bloat_multiplier = %i;", in onEmitCode() 550 v->codeAppendf("coverage = (coverage - .5) * aa_bloat_multiplier + .5;"); in onEmitCode() 624 v->codeAppendf( "%s.xy = float2(0, coverage * coverage_multiplier);", in onEmitCode() 633 v->codeAppendf( "%s.xy = float2(arccoord.x+1, arccoord.y);", arcCoord.vsOut()); in onEmitCode() 636 v->codeAppendf("float2x2 derivatives = inverse(skewmatrix);"); in onEmitCode() 637 v->codeAppendf("%s.zw = derivatives * (arccoord/radii * 2);", arcCoord.vsOut()); in onEmitCode() 642 f->codeAppendf("float x_plus_1=%s.x, y=%s.y;", arcCoord.fsIn(), arcCoord.fsIn()); in onEmitCode() 643 f->codeAppendf("half coverage;"); in onEmitCode() 644 f->codeAppendf("if (0 == x_plus_1) {"); in onEmitCode() [all …]
|