aboutsummaryrefslogtreecommitdiffhomepage
path: root/gpu/src/GrGpuGL.h
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/GrGpuGL.h
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/GrGpuGL.h')
-rw-r--r--gpu/src/GrGpuGL.h32
1 files changed, 8 insertions, 24 deletions
diff --git a/gpu/src/GrGpuGL.h b/gpu/src/GrGpuGL.h
index e46c2ceacb..d89b8d54d7 100644
--- a/gpu/src/GrGpuGL.h
+++ b/gpu/src/GrGpuGL.h
@@ -61,8 +61,7 @@ public:
protected:
struct {
- const void*
- fPositionPtr;
+ size_t fVertexOffset;
GrVertexLayout fVertexLayout;
const GrVertexBuffer* fVertexBuffer;
const GrIndexBuffer* fIndexBuffer;
@@ -72,28 +71,27 @@ protected:
DrState fHWDrawState;
bool fHWStencilClip;
+ // GrGpu overrides
virtual void drawIndexedHelper(PrimitiveType type,
uint32_t startVertex,
uint32_t startIndex,
uint32_t vertexCount,
uint32_t indexCount);
-
virtual void drawNonIndexedHelper(PrimitiveType type,
uint32_t vertexCount,
uint32_t numVertices);
-
virtual void flushScissor(const GrIRect* rect);
-
void eraseStencil(uint32_t value, uint32_t mask);
virtual void eraseStencilClip();
+ // binds texture unit in GL
void setTextureUnit(int unitIdx);
- // binds appropriate vertex and index buffers and returns either the ptr
- // to client memory or offset into a VB of the first vertex
- const GLvoid* setBuffersAndGetVertexStart(int vertexStride, int startVertex,
- int startIndex, int vertexCount,
- int indexCount);
+ // binds appropriate vertex and index buffers, also returns any extra
+ // extra verts or indices to offset by.
+ void setBuffers(bool indexed,
+ int* extraVertexOffset,
+ int* extraIndexOffset);
// flushes state that is common to fixed and programmable GL
// dither
@@ -118,13 +116,6 @@ protected:
GrGLExts fExts;
-#if GR_GL_NO_CLIENT_SIDE_ARRAYS
- void putClientVertexDataInBuffer(const void* vertexData,
- size_t vertexDataSize);
- void putClientIndexDataInBuffer(const void* indexData,
- size_t indexDataSize);
-#endif
-
private:
void resetContextHelper();
@@ -174,13 +165,6 @@ private:
int fActiveTextureUnitIdx;
typedef GrGpu INHERITED;
-
-#if GR_GL_NO_CLIENT_SIDE_ARRAYS
- GrGLVertexBuffer* fClientArrayVB;
- GrGLIndexBuffer* fClientArrayIB;
- int fOversizeVBDrawCnt;
- int fOversizeIBDrawCnt;
-#endif
};
bool has_gl_extension(const char* ext);