diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-02-14 16:51:21 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-02-14 16:51:21 +0000 |
commit | 1c13c9668a889e56a0c85b51b9f28139c25b76ff (patch) | |
tree | 0319884473e77141a574ab07333c6ed4797f7485 /gpu/src/GrDrawTarget.cpp | |
parent | dd53d91b60e368f1bbff6fb22d796765205ae25d (diff) |
Refactor how Gr handles vertex and index data. GrGpu and GrInOrderDrawBuffer both GrBufferAllocPool to manage reserved and set-to-array vertex and index data.
rietveld issue 4188049
git-svn-id: http://skia.googlecode.com/svn/trunk@786 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/src/GrDrawTarget.cpp')
-rw-r--r-- | gpu/src/GrDrawTarget.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/gpu/src/GrDrawTarget.cpp b/gpu/src/GrDrawTarget.cpp index 0f31e9a429..5cfc6f4895 100644 --- a/gpu/src/GrDrawTarget.cpp +++ b/gpu/src/GrDrawTarget.cpp @@ -458,20 +458,22 @@ void GrDrawTarget::releaseReservedGeometry() { fReservedGeometry.fLocked = false; } -void GrDrawTarget::setVertexSourceToArray(const void* array, - GrVertexLayout vertexLayout) { - fGeometrySrc.fVertexSrc = kArray_GeometrySrcType; - fGeometrySrc.fVertexArray = array; +void GrDrawTarget::setVertexSourceToArray(GrVertexLayout vertexLayout, + const void* vertexArray, + int vertexCount) { + fGeometrySrc.fVertexSrc = kArray_GeometrySrcType; fGeometrySrc.fVertexLayout = vertexLayout; + setVertexSourceToArrayHelper(vertexArray, vertexCount); } -void GrDrawTarget::setIndexSourceToArray(const void* array) { - fGeometrySrc.fIndexSrc = kArray_GeometrySrcType; - fGeometrySrc.fIndexArray = array; +void GrDrawTarget::setIndexSourceToArray(const void* indexArray, + int indexCount) { + fGeometrySrc.fIndexSrc = kArray_GeometrySrcType; + setIndexSourceToArrayHelper(indexArray, indexCount); } -void GrDrawTarget::setVertexSourceToBuffer(const GrVertexBuffer* buffer, - GrVertexLayout vertexLayout) { +void GrDrawTarget::setVertexSourceToBuffer(GrVertexLayout vertexLayout, + const GrVertexBuffer* buffer) { fGeometrySrc.fVertexSrc = kBuffer_GeometrySrcType; fGeometrySrc.fVertexBuffer = buffer; fGeometrySrc.fVertexLayout = vertexLayout; |