Lines Matching refs:fsBuilder
339 GrGLSLPPFragmentBuilder* fsBuilder = args.fFragBuilder;
340 SkAssertResult(fsBuilder->enableFeature(
342 SkAssertResult(fsBuilder->enableFeature(
344 fsBuilder->declAppendf(GR_GL_PLS_PATH_DATA_DECL);
349 fsBuilder->codeAppendf("highp vec2 firstSample = %s.xy - vec2(0.25);",
350 fsBuilder->fragmentPosition());
351 fsBuilder->codeAppendf("highp vec2 delta1 = %s;", delta1.fsIn());
352 fsBuilder->codeAppendf("highp vec2 delta2 = %s;", delta2.fsIn());
353 fsBuilder->codeAppendf("highp vec2 delta3 = %s;", delta3.fsIn());
358 fsBuilder->codeAppendf("highp float d1 = dot(delta1, (firstSample - %s).yx) * 2.0;",
360 fsBuilder->codeAppendf("highp float d2 = dot(delta2, (firstSample - %s).yx) * 2.0;",
362 fsBuilder->codeAppendf("highp float d3 = dot(delta3, (firstSample - %s).yx) * 2.0;",
364 fsBuilder->codeAppend("highp float dmax = max(d1, max(d2, d3));");
365 fsBuilder->codeAppendf("pls.windings[0] += (dmax <= 0.0) ? %s : 0;", windings.fsIn());
368 fsBuilder->codeAppend("d1 += delta1.x;");
369 fsBuilder->codeAppend("d2 += delta2.x;");
370 fsBuilder->codeAppend("d3 += delta3.x;");
371 fsBuilder->codeAppend("dmax = max(d1, max(d2, d3));");
372 fsBuilder->codeAppendf("pls.windings[1] += (dmax <= 0.0) ? %s : 0;", windings.fsIn());
373 fsBuilder->codeAppend("d1 += delta1.y;");
374 fsBuilder->codeAppend("d2 += delta2.y;");
375 fsBuilder->codeAppend("d3 += delta3.y;");
376 fsBuilder->codeAppend("dmax = max(d1, max(d2, d3));");
377 fsBuilder->codeAppendf("pls.windings[2] += (dmax <= 0.0) ? %s : 0;", windings.fsIn());
378 fsBuilder->codeAppend("d1 -= delta1.x;");
379 fsBuilder->codeAppend("d2 -= delta2.x;");
380 fsBuilder->codeAppend("d3 -= delta3.x;");
381 fsBuilder->codeAppend("dmax = max(d1, max(d2, d3));");
382 fsBuilder->codeAppendf("pls.windings[3] += (dmax <= 0.0) ? %s : 0;", windings.fsIn());
527 GrGLSLPPFragmentBuilder* fsBuilder = args.fFragBuilder;
528 SkAssertResult(fsBuilder->enableFeature(
530 SkAssertResult(fsBuilder->enableFeature(
544 fsBuilder->emitFunction(kBool_GrSLType, "in_quad", QUAD_ARGS, inQuadArgs, inQuadCode,
546 fsBuilder->declAppendf(GR_GL_PLS_PATH_DATA_DECL);
548 fsBuilder->codeAppendf("highp vec2 uvdX = dFdx(%s);", uv.fsIn());
549 fsBuilder->codeAppendf("highp vec2 uvdY = dFdy(%s);", uv.fsIn());
550 fsBuilder->codeAppend("highp vec2 uvIncX = uvdX * 0.45 + uvdY * -0.1;");
551 fsBuilder->codeAppend("highp vec2 uvIncY = uvdX * 0.1 + uvdY * 0.55;");
552 fsBuilder->codeAppendf("highp vec2 uv = %s.xy - uvdX * 0.35 - uvdY * 0.25;",
554 fsBuilder->codeAppendf("highp vec2 firstSample = %s.xy - vec2(0.25);",
555 fsBuilder->fragmentPosition());
556 fsBuilder->codeAppendf("highp float d = dot(%s, (firstSample - %s).yx) * 2.0;",
558 fsBuilder->codeAppendf("pls.windings[0] += %s(d, uv) ? %s : 0;", inQuadName.c_str(),
560 fsBuilder->codeAppend("uv += uvIncX;");
561 fsBuilder->codeAppendf("d += %s.x;", delta.fsIn());
562 fsBuilder->codeAppendf("pls.windings[1] += %s(d, uv) ? %s : 0;", inQuadName.c_str(),
564 fsBuilder->codeAppend("uv += uvIncY;");
565 fsBuilder->codeAppendf("d += %s.y;", delta.fsIn());
566 fsBuilder->codeAppendf("pls.windings[2] += %s(d, uv) ? %s : 0;", inQuadName.c_str(),
568 fsBuilder->codeAppend("uv -= uvIncX;");
569 fsBuilder->codeAppendf("d -= %s.x;", delta.fsIn());
570 fsBuilder->codeAppendf("pls.windings[3] += %s(d, uv) ? %s : 0;", inQuadName.c_str(),
685 GrGLSLPPFragmentBuilder* fsBuilder = args.fFragBuilder;
686 SkAssertResult(fsBuilder->enableFeature(
688 fsBuilder->declAppendf(GR_GL_PLS_PATH_DATA_DECL);
689 fsBuilder->codeAppend("float coverage;");
690 fsBuilder->codeAppendf("if (%s != 0.0) {", useEvenOdd);
691 fsBuilder->codeAppend("coverage = float(abs(pls.windings[0]) % 2) * 0.25;");
692 fsBuilder->codeAppend("coverage += float(abs(pls.windings[1]) % 2) * 0.25;");
693 fsBuilder->codeAppend("coverage += float(abs(pls.windings[2]) % 2) * 0.25;");
694 fsBuilder->codeAppend("coverage += float(abs(pls.windings[3]) % 2) * 0.25;");
695 fsBuilder->codeAppend("} else {");
696 fsBuilder->codeAppend("coverage = pls.windings[0] != 0 ? 0.25 : 0.0;");
697 fsBuilder->codeAppend("coverage += pls.windings[1] != 0 ? 0.25 : 0.0;");
698 fsBuilder->codeAppend("coverage += pls.windings[2] != 0 ? 0.25 : 0.0;");
699 fsBuilder->codeAppend("coverage += pls.windings[3] != 0 ? 0.25 : 0.0;");
700 fsBuilder->codeAppend("}");
702 this->setupUniformColor(fsBuilder, uniformHandler, args.fOutputColor,
705 fsBuilder->codeAppendf("%s = vec4(coverage);", args.fOutputCoverage);
706 fsBuilder->codeAppendf("%s = vec4(1.0, 0.0, 1.0, 1.0);", args.fOutputColor);