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 #ifndef GrTestBatch_DEFINED | 8 #ifndef GrTestBatch_DEFINED |
9 #define GrTestBatch_DEFINED | 9 #define GrTestBatch_DEFINED |
10 | 10 |
11 #include "GrVertexBuffer.h" | 11 #include "GrVertexBuffer.h" |
12 | 12 |
13 #include "batches/GrBatch.h" | 13 #include "batches/GrBatch.h" |
14 | 14 |
15 /* | 15 /* |
16 * A simple batch only for testing purposes which actually doesn't batch at all,
but can fit into | 16 * A simple batch only for testing purposes which actually doesn't batch at all,
but can fit into |
17 * the batch pipeline and generate arbitrary geometry | 17 * the batch pipeline and generate arbitrary geometry |
18 */ | 18 */ |
19 class GrTestBatch : public GrBatch { | 19 class GrTestBatch : public GrVertexBatch { |
20 public: | 20 public: |
21 struct Geometry { | 21 struct Geometry { |
22 GrColor fColor; | 22 GrColor fColor; |
23 }; | 23 }; |
24 | 24 |
25 virtual const char* name() const override = 0; | 25 virtual const char* name() const override = 0; |
26 | 26 |
27 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { | 27 void getInvariantOutputColor(GrInitInvariantOutput* out) const override { |
28 // When this is called on a batch, there is only one geometry bundle | 28 // When this is called on a batch, there is only one geometry bundle |
29 out->setKnownFourComponents(this->geoData(0)->fColor); | 29 out->setKnownFourComponents(this->geoData(0)->fColor); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 bool fUsesLocalCoords; | 77 bool fUsesLocalCoords; |
78 bool fColorIgnored; | 78 bool fColorIgnored; |
79 bool fCoverageIgnored; | 79 bool fCoverageIgnored; |
80 }; | 80 }; |
81 | 81 |
82 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; | 82 SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor; |
83 BatchTracker fBatch; | 83 BatchTracker fBatch; |
84 }; | 84 }; |
85 | 85 |
86 #endif | 86 #endif |
OLD | NEW |