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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 GrGLVertToFrag v(kVec4f_GrSLType); | 535 GrGLVertToFrag v(kVec4f_GrSLType); |
536 args.fPB->addVarying("QuadEdge", &v); | 536 args.fPB->addVarying("QuadEdge", &v); |
537 vsBuilder->codeAppendf("%s = %s;", v.vsOut(), qe.inQuadEdge()->fName
); | 537 vsBuilder->codeAppendf("%s = %s;", v.vsOut(), qe.inQuadEdge()->fName
); |
538 | 538 |
539 const BatchTracker& local = args.fBT.cast<BatchTracker>(); | 539 const BatchTracker& local = args.fBT.cast<BatchTracker>(); |
540 | 540 |
541 // Setup pass through color | 541 // Setup pass through color |
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 uniform viewMatrix | |
546 this->addUniformViewMatrix(pb); | |
547 | |
548 // Setup position | 545 // Setup position |
549 SetupPosition(vsBuilder, gpArgs, qe.inPosition()->fName, | 546 this->setupPosition(pb, gpArgs, qe.inPosition()->fName, qe.viewMatri
x()); |
550 qe.viewMatrix(), this->uViewM()); | |
551 | 547 |
552 // emit transforms | 548 // emit transforms |
553 this->emitTransforms(args.fPB, gpArgs->fPositionVar, qe.inPosition()
->fName, | 549 this->emitTransforms(args.fPB, gpArgs->fPositionVar, qe.inPosition()
->fName, |
554 qe.localMatrix(), args.fTransformsIn, args.fTra
nsformsOut); | 550 qe.localMatrix(), args.fTransformsIn, args.fTra
nsformsOut); |
555 | 551 |
556 GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilde
r(); | 552 GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilde
r(); |
557 | 553 |
558 SkAssertResult(fsBuilder->enableFeature( | 554 SkAssertResult(fsBuilder->enableFeature( |
559 GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature)
); | 555 GrGLFragmentShaderBuilder::kStandardDerivatives_GLSLFeature)
); |
560 fsBuilder->codeAppendf("float edgeAlpha;"); | 556 fsBuilder->codeAppendf("float edgeAlpha;"); |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 geometry.fViewMatrix = vm; | 892 geometry.fViewMatrix = vm; |
897 geometry.fPath = path; | 893 geometry.fPath = path; |
898 SkDEBUGCODE(geometry.fDevBounds = devRect;) | 894 SkDEBUGCODE(geometry.fDevBounds = devRect;) |
899 | 895 |
900 SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry)); | 896 SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry)); |
901 target->drawBatch(pipelineBuilder, batch, &devRect); | 897 target->drawBatch(pipelineBuilder, batch, &devRect); |
902 | 898 |
903 return true; | 899 return true; |
904 | 900 |
905 } | 901 } |
OLD | NEW |