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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 const char* name() const SK_OVERRIDE { return "AAConvexBatch"; } | 704 const char* name() const SK_OVERRIDE { return "AAConvexBatch"; } |
705 | 705 |
706 void getInvariantOutputColor(GrInitInvariantOutput* out) const SK_OVERRIDE { | 706 void getInvariantOutputColor(GrInitInvariantOutput* out) const SK_OVERRIDE { |
707 // When this is called on a batch, there is only one geometry bundle | 707 // When this is called on a batch, there is only one geometry bundle |
708 out->setKnownFourComponents(fGeoData[0].fColor); | 708 out->setKnownFourComponents(fGeoData[0].fColor); |
709 } | 709 } |
710 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERRID
E { | 710 void getInvariantOutputCoverage(GrInitInvariantOutput* out) const SK_OVERRID
E { |
711 out->setUnknownSingleComponent(); | 711 out->setUnknownSingleComponent(); |
712 } | 712 } |
713 | 713 |
714 void initBatchOpt(const GrBatchOpt& batchOpt) { | |
715 fBatchOpt = batchOpt; | |
716 } | |
717 | |
718 void initBatchTracker(const GrPipelineInfo& init) SK_OVERRIDE { | 714 void initBatchTracker(const GrPipelineInfo& init) SK_OVERRIDE { |
719 // Handle any color overrides | 715 // Handle any color overrides |
720 if (init.fColorIgnored) { | 716 if (init.fColorIgnored) { |
721 fGeoData[0].fColor = GrColor_ILLEGAL; | 717 fGeoData[0].fColor = GrColor_ILLEGAL; |
722 } else if (GrColor_ILLEGAL != init.fOverrideColor) { | 718 } else if (GrColor_ILLEGAL != init.fOverrideColor) { |
723 fGeoData[0].fColor = init.fOverrideColor; | 719 fGeoData[0].fColor = init.fOverrideColor; |
724 } | 720 } |
725 | 721 |
726 // setup batch properties | 722 // setup batch properties |
727 fBatch.fColorIgnored = init.fColorIgnored; | 723 fBatch.fColorIgnored = init.fColorIgnored; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; } | 854 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; } |
859 const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; } | 855 const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; } |
860 | 856 |
861 struct BatchTracker { | 857 struct BatchTracker { |
862 GrColor fColor; | 858 GrColor fColor; |
863 bool fUsesLocalCoords; | 859 bool fUsesLocalCoords; |
864 bool fColorIgnored; | 860 bool fColorIgnored; |
865 bool fCoverageIgnored; | 861 bool fCoverageIgnored; |
866 }; | 862 }; |
867 | 863 |
868 GrBatchOpt fBatchOpt; | |
869 BatchTracker fBatch; | 864 BatchTracker fBatch; |
870 SkSTArray<1, Geometry, true> fGeoData; | 865 SkSTArray<1, Geometry, true> fGeoData; |
871 }; | 866 }; |
872 | 867 |
873 bool GrAAConvexPathRenderer::onDrawPath(GrDrawTarget* target, | 868 bool GrAAConvexPathRenderer::onDrawPath(GrDrawTarget* target, |
874 GrPipelineBuilder* pipelineBuilder, | 869 GrPipelineBuilder* pipelineBuilder, |
875 GrColor color, | 870 GrColor color, |
876 const SkMatrix& vm, | 871 const SkMatrix& vm, |
877 const SkPath& path, | 872 const SkPath& path, |
878 const SkStrokeRec&, | 873 const SkStrokeRec&, |
(...skipping 13 matching lines...) Expand all Loading... |
892 geometry.fViewMatrix = vm; | 887 geometry.fViewMatrix = vm; |
893 geometry.fPath = path; | 888 geometry.fPath = path; |
894 SkDEBUGCODE(geometry.fDevBounds = devRect;) | 889 SkDEBUGCODE(geometry.fDevBounds = devRect;) |
895 | 890 |
896 SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry)); | 891 SkAutoTUnref<GrBatch> batch(AAConvexPathBatch::Create(geometry)); |
897 target->drawBatch(pipelineBuilder, batch, &devRect); | 892 target->drawBatch(pipelineBuilder, batch, &devRect); |
898 | 893 |
899 return true; | 894 return true; |
900 | 895 |
901 } | 896 } |
OLD | NEW |