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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 bool targetHasReservedGeom = fDstGpu->hasReservedVerticesOrIndices(); | 632 bool targetHasReservedGeom = fDstGpu->hasReservedVerticesOrIndices(); |
633 | 633 |
634 int vcount = vertexCount; | 634 int vcount = vertexCount; |
635 int icount = indexCount; | 635 int icount = indexCount; |
636 | 636 |
637 if (!insideGeoPush && | 637 if (!insideGeoPush && |
638 !unreleasedVertexSpace && | 638 !unreleasedVertexSpace && |
639 !unreleasedIndexSpace && | 639 !unreleasedIndexSpace && |
640 !targetHasReservedGeom && | 640 !targetHasReservedGeom && |
641 this->geometryHints(&vcount, &icount)) { | 641 this->geometryHints(&vcount, &icount)) { |
642 | |
643 this->flush(); | 642 this->flush(); |
644 } | 643 } |
645 } | 644 } |
646 | 645 |
647 bool GrInOrderDrawBuffer::geometryHints(int* vertexCount, | 646 bool GrInOrderDrawBuffer::geometryHints(int* vertexCount, |
648 int* indexCount) const { | 647 int* indexCount) const { |
649 // we will recommend a flush if the data could fit in a single | 648 // we will recommend a flush if the data could fit in a single |
650 // preallocated buffer but none are left and it can't fit | 649 // preallocated buffer but none are left and it can't fit |
651 // in the current buffer (which may not be prealloced). | 650 // in the current buffer (which may not be prealloced). |
652 bool flush = false; | 651 bool flush = false; |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 fCmdBuffer.back().fType = add_trace_bit(fCmdBuffer.back().fType); | 857 fCmdBuffer.back().fType = add_trace_bit(fCmdBuffer.back().fType); |
859 fGpuCmdMarkers.push_back(activeTraceMarkers); | 858 fGpuCmdMarkers.push_back(activeTraceMarkers); |
860 } | 859 } |
861 } | 860 } |
862 | 861 |
863 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { | 862 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { |
864 INHERITED::clipWillBeSet(newClipData); | 863 INHERITED::clipWillBeSet(newClipData); |
865 fClipSet = true; | 864 fClipSet = true; |
866 fClipProxyState = kUnknown_ClipProxyState; | 865 fClipProxyState = kUnknown_ClipProxyState; |
867 } | 866 } |
OLD | NEW |