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 GrBatch_DEFINED | 8 #ifndef GrBatch_DEFINED |
9 #define GrBatch_DEFINED | 9 #define GrBatch_DEFINED |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 bool combineIfPossible(GrBatch* that) { | 55 bool combineIfPossible(GrBatch* that) { |
56 if (this->classID() != that->classID()) { | 56 if (this->classID() != that->classID()) { |
57 return false; | 57 return false; |
58 } | 58 } |
59 | 59 |
60 return this->onCombineIfPossible(that); | 60 return this->onCombineIfPossible(that); |
61 } | 61 } |
62 | 62 |
63 virtual bool onCombineIfPossible(GrBatch*) = 0; | 63 virtual bool onCombineIfPossible(GrBatch*) = 0; |
64 | 64 |
65 virtual void generateGeometry(GrBatchTarget*, const GrPipeline*) = 0; | 65 virtual void generateGeometry(GrBatchTarget*) = 0; |
66 | 66 |
67 const SkRect& bounds() const { return fBounds; } | 67 const SkRect& bounds() const { return fBounds; } |
68 | 68 |
69 // TODO this goes away when batches are everywhere | 69 // TODO this goes away when batches are everywhere |
70 void setNumberOfDraws(int numberOfDraws) { fNumberOfDraws = numberOfDraws; } | 70 void setNumberOfDraws(int numberOfDraws) { fNumberOfDraws = numberOfDraws; } |
71 int numberOfDraws() const { return fNumberOfDraws; } | 71 int numberOfDraws() const { return fNumberOfDraws; } |
72 | 72 |
73 void* operator new(size_t size); | 73 void* operator new(size_t size); |
74 void operator delete(void* target); | 74 void operator delete(void* target); |
75 | 75 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 }; | 169 }; |
170 SkAutoTUnref<const GrPipeline> fPipeline; | 170 SkAutoTUnref<const GrPipeline> fPipeline; |
171 static int32_t gCurrBatchClassID; | 171 static int32_t gCurrBatchClassID; |
172 int fNumberOfDraws; | 172 int fNumberOfDraws; |
173 SkDEBUGCODE(bool fUsed;) | 173 SkDEBUGCODE(bool fUsed;) |
174 | 174 |
175 typedef SkRefCnt INHERITED; | 175 typedef SkRefCnt INHERITED; |
176 }; | 176 }; |
177 | 177 |
178 #endif | 178 #endif |
OLD | NEW |