OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "GrInOrderDrawBuffer.h" | 8 #include "GrInOrderDrawBuffer.h" |
9 | 9 |
10 #include "GrBufferAllocPool.h" | 10 #include "GrBufferAllocPool.h" |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 | 505 |
506 this->reset(); | 506 this->reset(); |
507 ++fDrawID; | 507 ++fDrawID; |
508 } | 508 } |
509 | 509 |
510 void GrInOrderDrawBuffer::Draw::execute(GrInOrderDrawBuffer* buf, const GrOptDra
wState* optState) { | 510 void GrInOrderDrawBuffer::Draw::execute(GrInOrderDrawBuffer* buf, const GrOptDra
wState* optState) { |
511 if (!optState) { | 511 if (!optState) { |
512 return; | 512 return; |
513 } | 513 } |
514 GrGpu* dstGpu = buf->fDstGpu; | 514 GrGpu* dstGpu = buf->fDstGpu; |
515 dstGpu->setVertexSourceToBuffer(this->vertexBuffer(), optState->getVertexStr
ide()); | 515 fInfo.setVertexBuffer(this->vertexBuffer()); |
516 if (fInfo.isIndexed()) { | 516 fInfo.setIndexBuffer(this->indexBuffer()); |
517 dstGpu->setIndexSourceToBuffer(this->indexBuffer()); | |
518 } | |
519 dstGpu->draw(*optState, fInfo, fScissorState); | 517 dstGpu->draw(*optState, fInfo, fScissorState); |
520 } | 518 } |
521 | 519 |
522 void GrInOrderDrawBuffer::StencilPath::execute(GrInOrderDrawBuffer* buf, | 520 void GrInOrderDrawBuffer::StencilPath::execute(GrInOrderDrawBuffer* buf, |
523 const GrOptDrawState* optState) { | 521 const GrOptDrawState* optState) { |
524 if (!optState) { | 522 if (!optState) { |
525 return; | 523 return; |
526 } | 524 } |
527 buf->fDstGpu->stencilPath(*optState, this->path(), fScissorState, fStencilSe
ttings); | 525 buf->fDstGpu->stencilPath(*optState, this->path(), fScissorState, fStencilSe
ttings); |
528 } | 526 } |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 | 788 |
791 void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary() { | 789 void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary() { |
792 SkASSERT(!fCmdBuffer.empty()); | 790 SkASSERT(!fCmdBuffer.empty()); |
793 SkASSERT(!cmd_has_trace_marker(fCmdBuffer.back().fType)); | 791 SkASSERT(!cmd_has_trace_marker(fCmdBuffer.back().fType)); |
794 const GrTraceMarkerSet& activeTraceMarkers = this->getActiveTraceMarkers(); | 792 const GrTraceMarkerSet& activeTraceMarkers = this->getActiveTraceMarkers(); |
795 if (activeTraceMarkers.count() > 0) { | 793 if (activeTraceMarkers.count() > 0) { |
796 fCmdBuffer.back().fType = add_trace_bit(fCmdBuffer.back().fType); | 794 fCmdBuffer.back().fType = add_trace_bit(fCmdBuffer.back().fType); |
797 fGpuCmdMarkers.push_back(activeTraceMarkers); | 795 fGpuCmdMarkers.push_back(activeTraceMarkers); |
798 } | 796 } |
799 } | 797 } |
OLD | NEW |