diff options
author | 2014-11-04 07:47:55 -0800 | |
---|---|---|
committer | 2014-11-04 07:47:55 -0800 | |
commit | d1aa8ff8700cbc083c8c27b7368a8482e65cdb08 (patch) | |
tree | 3c800bc0ae4dddcd4d3d44c5c8bc3af70a94221b /src/gpu/GrInOrderDrawBuffer.cpp | |
parent | 7a10fb6bead0f63623307a7ff71b1dd323534a7f (diff) |
removing setVertexArraySource from drawtarget
BUG=skia:
Review URL: https://codereview.chromium.org/699733002
Diffstat (limited to 'src/gpu/GrInOrderDrawBuffer.cpp')
-rw-r--r-- | src/gpu/GrInOrderDrawBuffer.cpp | 52 |
1 files changed, 4 insertions, 48 deletions
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp index 04b9ba23d8..ec8972c95f 100644 --- a/src/gpu/GrInOrderDrawBuffer.cpp +++ b/src/gpu/GrInOrderDrawBuffer.cpp @@ -709,8 +709,7 @@ void GrInOrderDrawBuffer::releaseReservedVertexSpace() { // If we get a release vertex space call then our current source should either be reserved // or array (which we copied into reserved space). - SkASSERT(kReserved_GeometrySrcType == geoSrc.fVertexSrc || - kArray_GeometrySrcType == geoSrc.fVertexSrc); + SkASSERT(kReserved_GeometrySrcType == geoSrc.fVertexSrc); // When the caller reserved vertex buffer space we gave it back a pointer // provided by the vertex buffer pool. At each draw we tracked the largest @@ -730,8 +729,7 @@ void GrInOrderDrawBuffer::releaseReservedIndexSpace() { // If we get a release index space call then our current source should either be reserved // or array (which we copied into reserved space). - SkASSERT(kReserved_GeometrySrcType == geoSrc.fIndexSrc || - kArray_GeometrySrcType == geoSrc.fIndexSrc); + SkASSERT(kReserved_GeometrySrcType == geoSrc.fIndexSrc); // Similar to releaseReservedVertexSpace we return any unused portion at // the tail @@ -742,46 +740,6 @@ void GrInOrderDrawBuffer::releaseReservedIndexSpace() { poolState.fPoolStartIndex = 0; } -void GrInOrderDrawBuffer::onSetVertexSourceToArray(const void* vertexArray, int vertexCount) { - GeometryPoolState& poolState = fGeoPoolStateStack.back(); - SkASSERT(0 == poolState.fUsedPoolVertexBytes); -#ifdef SK_DEBUG - bool success = -#endif - fVertexPool.appendVertices(this->getVertexSize(), - vertexCount, - vertexArray, - &poolState.fPoolVertexBuffer, - &poolState.fPoolStartVertex); - GR_DEBUGASSERT(success); -} - -void GrInOrderDrawBuffer::onSetIndexSourceToArray(const void* indexArray, - int indexCount) { - GeometryPoolState& poolState = fGeoPoolStateStack.back(); - SkASSERT(0 == poolState.fUsedPoolIndexBytes); -#ifdef SK_DEBUG - bool success = -#endif - fIndexPool.appendIndices(indexCount, - indexArray, - &poolState.fPoolIndexBuffer, - &poolState.fPoolStartIndex); - GR_DEBUGASSERT(success); -} - -void GrInOrderDrawBuffer::releaseVertexArray() { - // When the client provides an array as the vertex source we handled it - // by copying their array into reserved space. - this->GrInOrderDrawBuffer::releaseReservedVertexSpace(); -} - -void GrInOrderDrawBuffer::releaseIndexArray() { - // When the client provides an array as the index source we handled it - // by copying their array into reserved space. - this->GrInOrderDrawBuffer::releaseReservedIndexSpace(); -} - void GrInOrderDrawBuffer::geometrySourceWillPush() { GeometryPoolState& poolState = fGeoPoolStateStack.push_back(); poolState.fUsedPoolVertexBytes = 0; @@ -801,12 +759,10 @@ void GrInOrderDrawBuffer::geometrySourceWillPop(const GeometrySrcState& restored // we have to assume that any slack we had in our vertex/index data // is now unreleasable because data may have been appended later in the // pool. - if (kReserved_GeometrySrcType == restoredState.fVertexSrc || - kArray_GeometrySrcType == restoredState.fVertexSrc) { + if (kReserved_GeometrySrcType == restoredState.fVertexSrc) { poolState.fUsedPoolVertexBytes = restoredState.fVertexSize * restoredState.fVertexCount; } - if (kReserved_GeometrySrcType == restoredState.fIndexSrc || - kArray_GeometrySrcType == restoredState.fIndexSrc) { + if (kReserved_GeometrySrcType == restoredState.fIndexSrc) { poolState.fUsedPoolIndexBytes = sizeof(uint16_t) * restoredState.fIndexCount; } |