| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrAAConvexPathRenderer.h" | 9 #include "GrAAConvexPathRenderer.h" |
| 10 | 10 |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 this->setupColorPassThrough(pb, local.fInputColorType, args.fOutputC
olor, NULL, | 542 this->setupColorPassThrough(pb, local.fInputColorType, args.fOutputC
olor, NULL, |
| 543 &fColorUniform); | 543 &fColorUniform); |
| 544 | 544 |
| 545 // Setup position | 545 // Setup position |
| 546 this->setupPosition(pb, gpArgs, qe.inPosition()->fName, qe.viewMatri
x()); | 546 this->setupPosition(pb, gpArgs, qe.inPosition()->fName, qe.viewMatri
x()); |
| 547 | 547 |
| 548 // emit transforms | 548 // emit transforms |
| 549 this->emitTransforms(args.fPB, gpArgs->fPositionVar, qe.inPosition()
->fName, | 549 this->emitTransforms(args.fPB, gpArgs->fPositionVar, qe.inPosition()
->fName, |
| 550 qe.localMatrix(), args.fTransformsIn, args.fTra
nsformsOut); | 550 qe.localMatrix(), args.fTransformsIn, args.fTra
nsformsOut); |
| 551 | 551 |
| 552 GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilde
r(); | 552 GrGLFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(
); |
| 553 | 553 |
| 554 SkAssertResult(fsBuilder->enableFeature( | 554 SkAssertResult(fsBuilder->enableFeature( |
| 555 GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature)
); | 555 GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature)
); |
| 556 fsBuilder->codeAppendf("float edgeAlpha;"); | 556 fsBuilder->codeAppendf("float edgeAlpha;"); |
| 557 | 557 |
| 558 // keep the derivative instructions outside the conditional | 558 // keep the derivative instructions outside the conditional |
| 559 fsBuilder->codeAppendf("vec2 duvdx = dFdx(%s.xy);", v.fsIn()); | 559 fsBuilder->codeAppendf("vec2 duvdx = dFdx(%s.xy);", v.fsIn()); |
| 560 fsBuilder->codeAppendf("vec2 duvdy = dFdy(%s.xy);", v.fsIn()); | 560 fsBuilder->codeAppendf("vec2 duvdy = dFdy(%s.xy);", v.fsIn()); |
| 561 fsBuilder->codeAppendf("if (%s.z > 0.0 && %s.w > 0.0) {", v.fsIn(),
v.fsIn()); | 561 fsBuilder->codeAppendf("if (%s.z > 0.0 && %s.w > 0.0) {", v.fsIn(),
v.fsIn()); |
| 562 // today we know z and w are in device space. We could use derivativ
es | 562 // today we know z and w are in device space. We could use derivativ
es |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 geometry.fColor = color; | 885 geometry.fColor = color; |
| 886 geometry.fViewMatrix = vm; | 886 geometry.fViewMatrix = vm; |
| 887 geometry.fPath = path; | 887 geometry.fPath = path; |
| 888 | 888 |
| 889 SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry)); | 889 SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry)); |
| 890 target->drawBatch(pipelineBuilder, batch, &devRect); | 890 target->drawBatch(pipelineBuilder, batch, &devRect); |
| 891 | 891 |
| 892 return true; | 892 return true; |
| 893 | 893 |
| 894 } | 894 } |
| OLD | NEW |