Lines Matching +full:- +full:qe
4 * Use of this source code is governed by a BSD-style license that can be
48 this->setTransformDataHelper(ce.localMatrix(), pdman, &transformIter); in setData()
76 varyingHandler->emitAttributes(gp); in onEmitCode()
79 varyingHandler->addVarying("ConicCoeffs", &v); in onEmitCode()
80 vertBuilder->codeAppendf("%s = %s;", v.vsOut(), gp.inConicCoeffs().name()); in onEmitCode()
84 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform); in onEmitCode()
87 this->writeOutputPosition(vertBuilder, in onEmitCode()
95 this->emitTransforms(vertBuilder, in onEmitCode()
115 fragBuilder->declAppend(edgeAlpha); in onEmitCode()
116 fragBuilder->declAppend(dklmdx); in onEmitCode()
117 fragBuilder->declAppend(dklmdy); in onEmitCode()
118 fragBuilder->declAppend(dfdx); in onEmitCode()
119 fragBuilder->declAppend(dfdy); in onEmitCode()
120 fragBuilder->declAppend(gF); in onEmitCode()
121 fragBuilder->declAppend(gFM); in onEmitCode()
122 fragBuilder->declAppend(func); 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()
147 fragBuilder->codeAppendf("%s = max(1.0 - %s, 0.0);", in onEmitCode()
150 // fragBuilder->codeAppend("edgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);"); in onEmitCode()
154 fragBuilder->codeAppendf("%s = dFdx(%s.xyz);", dklmdx.c_str(), v.fsIn()); in onEmitCode()
155 fragBuilder->codeAppendf("%s = dFdy(%s.xyz);", dklmdy.c_str(), v.fsIn()); in onEmitCode()
156 fragBuilder->codeAppendf("%s =" in onEmitCode()
157 "2.0 * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;", in onEmitCode()
162 fragBuilder->codeAppendf("%s =" in onEmitCode()
163 "2.0 * %s.x * %s.x - %s.y * %s.z - %s.z * %s.y;", in onEmitCode()
168 fragBuilder->codeAppendf("%s = float2(%s, %s);", gF.c_str(), dfdx.c_str(), in onEmitCode()
170 fragBuilder->codeAppendf("%s = sqrt(dot(%s, %s));", in onEmitCode()
172 fragBuilder->codeAppendf("%s = %s.x * %s.x - %s.y * %s.z;", in onEmitCode()
174 fragBuilder->codeAppendf("%s = %s / %s;", in onEmitCode()
176 fragBuilder->codeAppendf("%s = saturate(0.5 - %s);", in onEmitCode()
179 // fragBuilder->codeAppend("edgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);"); in onEmitCode()
183 fragBuilder->codeAppendf("%s = %s.x * %s.x - %s.y * %s.z;", in onEmitCode()
185 fragBuilder->codeAppendf("%s = float(%s < 0.0);", in onEmitCode()
196 fCoverageScaleUniform = uniformHandler->addUniform(kFragment_GrShaderFlag, in onEmitCode()
200 fragBuilder->codeAppendf("%s = half4(%s * %s);", in onEmitCode()
203 fragBuilder->codeAppendf("%s = half4(%s);", args.fOutputCoverage, edgeAlpha.c_str()); in onEmitCode()
215 b->add32(key); in GenKey()
243 this->setVertexAttributes(kAttributes, SK_ARRAY_COUNT(kAttributes)); in GrConicEffect()
256 d->fRandom->nextULessThan(kGrClipEdgeTypeCnt)); in TestCreate()
257 gp = GrConicEffect::Make(SkPMColor4f::FromBytes_RGBA(GrRandomColor(d->fRandom)), in TestCreate()
258 GrTest::TestMatrix(d->fRandom), edgeType, *d->caps(), in TestCreate()
259 GrTest::TestMatrix(d->fRandom), d->fRandom->nextBool()); in TestCreate()
281 const GrQuadEffect& qe = primProc.cast<GrQuadEffect>(); in setData() local
283 if (!qe.viewMatrix().isIdentity() && !fViewMatrix.cheapEqualTo(qe.viewMatrix())) { in setData()
284 fViewMatrix = qe.viewMatrix(); in setData()
290 if (qe.color() != fColor) { in setData()
291 pdman.set4fv(fColorUniform, 1, qe.color().vec()); in setData()
292 fColor = qe.color(); in setData()
295 if (qe.coverageScale() != 0xff && qe.coverageScale() != fCoverageScale) { in setData()
296 pdman.set1f(fCoverageScaleUniform, GrNormalizeByteToFloat(qe.coverageScale())); in setData()
297 fCoverageScale = qe.coverageScale(); in setData()
299 this->setTransformDataHelper(qe.localMatrix(), pdman, &transformIter); in setData()
327 varyingHandler->emitAttributes(gp); in onEmitCode()
330 varyingHandler->addVarying("HairQuadEdge", &v); in onEmitCode()
331 vertBuilder->codeAppendf("%s = %s;", v.vsOut(), gp.inHairQuadEdge().name()); in onEmitCode()
335 this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform); in onEmitCode()
338 this->writeOutputPosition(vertBuilder, in onEmitCode()
346 this->emitTransforms(vertBuilder, in onEmitCode()
353 fragBuilder->codeAppendf("half edgeAlpha;"); in onEmitCode()
357 fragBuilder->codeAppendf("half2 duvdx = dFdx(%s.xy);", v.fsIn()); in onEmitCode()
358 fragBuilder->codeAppendf("half2 duvdy = dFdy(%s.xy);", v.fsIn()); in onEmitCode()
359 fragBuilder->codeAppendf("half2 gF = half2(2.0 * %s.x * duvdx.x - duvdx.y," in onEmitCode()
360 " 2.0 * %s.x * duvdy.x - duvdy.y);", in onEmitCode()
362 fragBuilder->codeAppendf("edgeAlpha = (%s.x * %s.x - %s.y);", in onEmitCode()
364 fragBuilder->codeAppend("edgeAlpha = sqrt(edgeAlpha * edgeAlpha / dot(gF, gF));"); in onEmitCode()
365 fragBuilder->codeAppend("edgeAlpha = max(1.0 - edgeAlpha, 0.0);"); in onEmitCode()
367 // fragBuilder->codeAppend("edgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);"); in onEmitCode()
371 fragBuilder->codeAppendf("half2 duvdx = dFdx(%s.xy);", v.fsIn()); in onEmitCode()
372 fragBuilder->codeAppendf("half2 duvdy = dFdy(%s.xy);", v.fsIn()); in onEmitCode()
373 fragBuilder->codeAppendf("half2 gF = half2(2.0 * %s.x * duvdx.x - duvdx.y," in onEmitCode()
374 " 2.0 * %s.x * duvdy.x - duvdy.y);", in onEmitCode()
376 fragBuilder->codeAppendf("edgeAlpha = (%s.x * %s.x - %s.y);", in onEmitCode()
378 fragBuilder->codeAppend("edgeAlpha = edgeAlpha / sqrt(dot(gF, gF));"); in onEmitCode()
379 fragBuilder->codeAppend("edgeAlpha = saturate(0.5 - edgeAlpha);"); in onEmitCode()
381 // fragBuilder->codeAppend("edgeAlpha = edgeAlpha*edgeAlpha*(3.0-2.0*edgeAlpha);"); in onEmitCode()
385 fragBuilder->codeAppendf("edgeAlpha = (%s.x * %s.x - %s.y);", in onEmitCode()
387 fragBuilder->codeAppend("edgeAlpha = half(edgeAlpha < 0.0);"); in onEmitCode()
396 fCoverageScaleUniform = uniformHandler->addUniform(kFragment_GrShaderFlag, in onEmitCode()
400 fragBuilder->codeAppendf("%s = half4(%s * edgeAlpha);", args.fOutputCoverage, in onEmitCode()
403 fragBuilder->codeAppendf("%s = half4(edgeAlpha);", args.fOutputCoverage); in onEmitCode()
415 b->add32(key); in GenKey()
443 this->setVertexAttributes(kAttributes, SK_ARRAY_COUNT(kAttributes)); in GrQuadEffect()
455 d->fRandom->nextULessThan(kGrClipEdgeTypeCnt)); in TestCreate()
456 gp = GrQuadEffect::Make(SkPMColor4f::FromBytes_RGBA(GrRandomColor(d->fRandom)), in TestCreate()
457 GrTest::TestMatrix(d->fRandom), edgeType, *d->caps(), in TestCreate()
458 GrTest::TestMatrix(d->fRandom), d->fRandom->nextBool()); in TestCreate()