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