OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrPLSPathRenderer.h" | 8 #include "GrPLSPathRenderer.h" |
9 | 9 |
10 #include "SkChunkAlloc.h" | 10 #include "SkChunkAlloc.h" |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 | 786 |
787 class PLSPathBatch : public GrVertexBatch { | 787 class PLSPathBatch : public GrVertexBatch { |
788 public: | 788 public: |
789 DEFINE_BATCH_CLASS_ID | 789 DEFINE_BATCH_CLASS_ID |
790 PLSPathBatch(GrColor color, const SkPath& path, const SkMatrix& viewMatrix) | 790 PLSPathBatch(GrColor color, const SkPath& path, const SkMatrix& viewMatrix) |
791 : INHERITED(ClassID()) | 791 : INHERITED(ClassID()) |
792 , fColor(color) | 792 , fColor(color) |
793 , fPath(path) | 793 , fPath(path) |
794 , fViewMatrix(viewMatrix) { | 794 , fViewMatrix(viewMatrix) { |
795 // compute bounds | 795 // compute bounds |
796 fBounds = path.getBounds(); | 796 this->setTransformedBounds(path.getBounds(), fViewMatrix, HasAABloat::kY
es, |
797 fViewMatrix.mapRect(&fBounds); | 797 IsZeroArea::kNo); |
798 } | 798 } |
799 | 799 |
800 const char* name() const override { return "PLSBatch"; } | 800 const char* name() const override { return "PLSBatch"; } |
801 | 801 |
802 void computePipelineOptimizations(GrInitInvariantOutput* color, | 802 void computePipelineOptimizations(GrInitInvariantOutput* color, |
803 GrInitInvariantOutput* coverage, | 803 GrInitInvariantOutput* coverage, |
804 GrBatchToXPOverrides* overrides) const ove
rride { | 804 GrBatchToXPOverrides* overrides) const ove
rride { |
805 // When this is called on a batch, there is only one geometry bundle | 805 // When this is called on a batch, there is only one geometry bundle |
806 color->setKnownFourComponents(fColor); | 806 color->setKnownFourComponents(fColor); |
807 coverage->setUnknownSingleComponent(); | 807 coverage->setUnknownSingleComponent(); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 | 967 |
968 DRAW_BATCH_TEST_DEFINE(PLSPathBatch) { | 968 DRAW_BATCH_TEST_DEFINE(PLSPathBatch) { |
969 GrColor color = GrRandomColor(random); | 969 GrColor color = GrRandomColor(random); |
970 SkMatrix vm = GrTest::TestMatrixInvertible(random); | 970 SkMatrix vm = GrTest::TestMatrixInvertible(random); |
971 SkPath path = GrTest::TestPathConvex(random); | 971 SkPath path = GrTest::TestPathConvex(random); |
972 | 972 |
973 return new PLSPathBatch(color, path, vm); | 973 return new PLSPathBatch(color, path, vm); |
974 } | 974 } |
975 | 975 |
976 #endif | 976 #endif |
OLD | NEW |