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(GrDrawContext* dc, GrRenderTarget*
rt, GrContext* context) |
| 20 : INHERITED(dc, rt, context) |
| 21 // , fBatchTarget(context->foo(), this->getGpu(), rt) |
| 22 , fDrawID(0) { |
| 23 } |
| 24 |
| 25 GrImmediateDrawTarget::~GrImmediateDrawTarget() { |
| 26 this->reset(); |
| 27 } |
| 28 |
| 29 void GrImmediateDrawTarget::onDrawBatch(GrBatch* batch) { |
| 30 |
| 31 #if 0 |
| 32 // TODO: encapsulate the specialization of GrVertexBatch in GrVertexBatch so
that we can |
| 33 // remove this cast. Currently all GrDrawBatches are in fact GrVertexBatch. |
| 34 GrVertexBatch* vertexBatch = static_cast<GrVertexBatch*>(batch); |
| 35 vertexBatch->prepareDraws(&fBatchTarget); |
| 36 vertexBatch->setNumberOfDraws(fBatchTarget.numberOfDraws()); |
| 37 |
| 38 fBatchTarget.preFlush(); |
| 39 fBatchTarget.flushNext(vertexBatch->numberOfDraws()); |
| 40 fBatchTarget.postFlush(); |
| 41 #endif |
| 42 } |
| 43 |
| 44 void GrImmediateDrawTarget::onReset() {} |
| 45 |
| 46 void GrImmediateDrawTarget::onFlush() { |
| 47 ++fDrawID; |
| 48 } |
OLD | NEW |