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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 const GrGLCaps&) const over
ride { | 616 const GrGLCaps&) const over
ride { |
617 return SkNEW_ARGS(GLProcessor, (*this, bt)); | 617 return SkNEW_ARGS(GLProcessor, (*this, bt)); |
618 } | 618 } |
619 | 619 |
620 void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const
override { | 620 void initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const
override { |
621 BatchTracker* local = bt->cast<BatchTracker>(); | 621 BatchTracker* local = bt->cast<BatchTracker>(); |
622 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, false); | 622 local->fInputColorType = GetColorInputType(&local->fColor, this->color()
, init, false); |
623 local->fUsesLocalCoords = init.fUsesLocalCoords; | 623 local->fUsesLocalCoords = init.fUsesLocalCoords; |
624 } | 624 } |
625 | 625 |
| 626 bool onCanMakeEqual(const GrBatchTracker& m, |
| 627 const GrGeometryProcessor& that, |
| 628 const GrBatchTracker& t) const override { |
| 629 const BatchTracker& mine = m.cast<BatchTracker>(); |
| 630 const BatchTracker& theirs = t.cast<BatchTracker>(); |
| 631 return CanCombineLocalMatrices(*this, mine.fUsesLocalCoords, |
| 632 that, theirs.fUsesLocalCoords) && |
| 633 CanCombineOutput(mine.fInputColorType, mine.fColor, |
| 634 theirs.fInputColorType, theirs.fColor); |
| 635 } |
| 636 |
626 private: | 637 private: |
627 QuadEdgeEffect(GrColor color, const SkMatrix& localMatrix) | 638 QuadEdgeEffect(GrColor color, const SkMatrix& localMatrix) |
628 : INHERITED(color, SkMatrix::I(), localMatrix) { | 639 : INHERITED(color, SkMatrix::I(), localMatrix) { |
629 this->initClassID<QuadEdgeEffect>(); | 640 this->initClassID<QuadEdgeEffect>(); |
630 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVe
rtexAttribType)); | 641 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVe
rtexAttribType)); |
631 fInQuadEdge = &this->addVertexAttrib(Attribute("inQuadEdge", kVec4f_GrVe
rtexAttribType)); | 642 fInQuadEdge = &this->addVertexAttrib(Attribute("inQuadEdge", kVec4f_GrVe
rtexAttribType)); |
632 } | 643 } |
633 | 644 |
| 645 bool onIsEqual(const GrGeometryProcessor& other) const override { |
| 646 return true; |
| 647 } |
| 648 |
| 649 void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const override
{ |
| 650 out->setUnknownSingleComponent(); |
| 651 } |
| 652 |
634 struct BatchTracker { | 653 struct BatchTracker { |
635 GrGPInput fInputColorType; | 654 GrGPInput fInputColorType; |
636 GrColor fColor; | 655 GrColor fColor; |
637 bool fUsesLocalCoords; | 656 bool fUsesLocalCoords; |
638 }; | 657 }; |
639 | 658 |
640 const Attribute* fInPosition; | 659 const Attribute* fInPosition; |
641 const Attribute* fInQuadEdge; | 660 const Attribute* fInQuadEdge; |
642 | 661 |
643 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 662 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 geometry.fColor = color; | 885 geometry.fColor = color; |
867 geometry.fViewMatrix = vm; | 886 geometry.fViewMatrix = vm; |
868 geometry.fPath = path; | 887 geometry.fPath = path; |
869 | 888 |
870 SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry)); | 889 SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry)); |
871 target->drawBatch(pipelineBuilder, batch, &devRect); | 890 target->drawBatch(pipelineBuilder, batch, &devRect); |
872 | 891 |
873 return true; | 892 return true; |
874 | 893 |
875 } | 894 } |
OLD | NEW |