Fix vertex/index buffer leaks

TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/1123823004
This commit is contained in:
bsalomon 2015-05-05 13:20:09 -07:00 committed by Commit bot
parent e3aeaec7dd
commit 301f989c65

View File

@ -29,7 +29,7 @@ public:
SkASSERT(vertexCount);
SkASSERT(startVertex >= 0);
fPrimitiveType = primType;
fVertexBuffer.reset(SkRef(vertexBuffer));
fVertexBuffer.reset(vertexBuffer);
fIndexBuffer.reset(NULL);
fStartVertex = startVertex;
fStartIndex = 0;
@ -54,8 +54,8 @@ public:
SkASSERT(startIndex >= 0);
SkASSERT(startVertex >= 0);
fPrimitiveType = primType;
fVertexBuffer.reset(SkRef(vertexBuffer));
fIndexBuffer.reset(SkRef(indexBuffer));
fVertexBuffer.reset(vertexBuffer);
fIndexBuffer.reset(indexBuffer);
fStartVertex = startVertex;
fStartIndex = startIndex;
fVertexCount = vertexCount;
@ -79,8 +79,8 @@ public:
SkASSERT(indicesPerInstance);
SkASSERT(startVertex >= 0);
fPrimitiveType = primType;
fVertexBuffer.reset(SkRef(vertexBuffer));
fIndexBuffer.reset(SkRef(indexBuffer));
fVertexBuffer.reset(vertexBuffer);
fIndexBuffer.reset(indexBuffer);
fStartVertex = startVertex;
fStartIndex = 0;
fVerticesPerInstance = verticesPerInstance;