aboutsummaryrefslogtreecommitdiffhomepage
path: root/gpu/src/GrDrawTarget.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-02-14 16:51:21 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-02-14 16:51:21 +0000
commit1c13c9668a889e56a0c85b51b9f28139c25b76ff (patch)
tree0319884473e77141a574ab07333c6ed4797f7485 /gpu/src/GrDrawTarget.cpp
parentdd53d91b60e368f1bbff6fb22d796765205ae25d (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.cpp20
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;