| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright 2015 Google Inc. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license that can be | |
| 5 * found in the LICENSE file. | |
| 6 */ | |
| 7 | |
| 8 #include "GrImmediateDrawTarget.h" | |
| 9 | |
| 10 #include "GrGpu.h" | |
| 11 #include "GrPipeline.h" | |
| 12 #include "GrRenderTarget.h" | |
| 13 #include "SkRect.h" | |
| 14 #include "SkTypes.h" | |
| 15 | |
| 16 #include "batches/GrDrawBatch.h" | |
| 17 #include "batches/GrVertexBatch.h" | |
| 18 | |
| 19 GrImmediateDrawTarget::GrImmediateDrawTarget(GrContext* context) | |
| 20 : INHERITED(context) | |
| 21 , fDrawID(0) { | |
| 22 } | |
| 23 | |
| 24 GrImmediateDrawTarget::~GrImmediateDrawTarget() { | |
| 25 this->reset(); | |
| 26 } | |
| 27 | |
| 28 void GrImmediateDrawTarget::onDrawBatch(GrBatch* batch) { | |
| 29 | |
| 30 #if 0 | |
| 31 // TODO: encapsulate the specialization of GrVertexBatch in GrVertexBatch so
that we can | |
| 32 // remove this cast. Currently all GrDrawBatches are in fact GrVertexBatch. | |
| 33 GrVertexBatch* vertexBatch = static_cast<GrVertexBatch*>(batch); | |
| 34 vertexBatch->prepareDraws(&fBatchTarget); | |
| 35 vertexBatch->setNumberOfDraws(fBatchTarget.numberOfDraws()); | |
| 36 | |
| 37 fBatchTarget.preFlush(); | |
| 38 fBatchTarget.flushNext(vertexBatch->numberOfDraws()); | |
| 39 fBatchTarget.postFlush(); | |
| 40 #endif | |
| 41 } | |
| 42 | |
| 43 void GrImmediateDrawTarget::onReset() {} | |
| 44 | |
| 45 void GrImmediateDrawTarget::onFlush() { | |
| 46 ++fDrawID; | |
| 47 } | |
| OLD | NEW |