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 GrBatchBuffer_DEFINED | 8 #ifndef GrBatchBuffer_DEFINED |
9 #define GrBatchBuffer_DEFINED | 9 #define GrBatchBuffer_DEFINED |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 return fGpu->writePixels(texture, left, top, width, height, config, buff
er, rowBytes); | 37 return fGpu->writePixels(texture, left, top, width, height, config, buff
er, rowBytes); |
38 } | 38 } |
39 | 39 |
40 private: | 40 private: |
41 GrGpu* fGpu; | 41 GrGpu* fGpu; |
42 }; | 42 }; |
43 | 43 |
44 /** Tracks the state across all the GrBatches in a GrDrawTarget flush. */ | 44 /** Tracks the state across all the GrBatches in a GrDrawTarget flush. */ |
45 class GrBatchFlushState { | 45 class GrBatchFlushState { |
46 public: | 46 public: |
47 GrBatchFlushState(GrGpu*, GrResourceProvider*, GrBatchToken lastFlushedToken
); | 47 GrBatchFlushState(GrGpu*, GrResourceProvider*); |
48 | 48 |
49 ~GrBatchFlushState() { this->reset(); } | 49 ~GrBatchFlushState() { this->reset(); } |
50 | 50 |
51 void advanceToken() { ++fCurrentToken; } | 51 void advanceToken() { ++fCurrentToken; } |
52 | 52 |
53 void advanceLastFlushedToken() { ++fLastFlushedToken; } | 53 void advanceLastFlushedToken() { ++fLastFlushedToken; } |
54 | 54 |
55 /** Inserts an upload to be executred after all batches in the flush prepare
d their draws | 55 /** Inserts an upload to be executred after all batches in the flush prepare
d their draws |
56 but before the draws are executed to the backend 3D API. */ | 56 but before the draws are executed to the backend 3D API. */ |
57 void addASAPUpload(GrBatchUploader* upload) { | 57 void addASAPUpload(GrBatchUploader* upload) { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 void putBackVertices(int vertices, size_t vertexStride) { | 185 void putBackVertices(int vertices, size_t vertexStride) { |
186 this->state()->putBackVertexSpace(vertices * vertexStride); | 186 this->state()->putBackVertexSpace(vertices * vertexStride); |
187 } | 187 } |
188 | 188 |
189 private: | 189 private: |
190 GrVertexBatch* vertexBatch() { return static_cast<GrVertexBatch*>(this->batc
h()); } | 190 GrVertexBatch* vertexBatch() { return static_cast<GrVertexBatch*>(this->batc
h()); } |
191 typedef GrDrawBatch::Target INHERITED; | 191 typedef GrDrawBatch::Target INHERITED; |
192 }; | 192 }; |
193 | 193 |
194 #endif | 194 #endif |
OLD | NEW |