Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1471)

Unified Diff: gpu/src/GrGpuGL.cpp

Issue 4631056: Refactor GrDrawTarget vertex/index api (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: rebase Created 13 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/src/GrGpuGL.h ('k') | gpu/src/GrGpuGLFixed.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/src/GrGpuGL.cpp
===================================================================
--- gpu/src/GrGpuGL.cpp (revision 1661)
+++ gpu/src/GrGpuGL.cpp (working copy)
@@ -1401,11 +1401,11 @@
#endif
#endif
-void GrGpuGL::onDrawIndexed(GrPrimitiveType type,
- uint32_t startVertex,
- uint32_t startIndex,
- uint32_t vertexCount,
- uint32_t indexCount) {
+void GrGpuGL::onGpuDrawIndexed(GrPrimitiveType type,
+ uint32_t startVertex,
+ uint32_t startIndex,
+ uint32_t vertexCount,
+ uint32_t indexCount) {
GrAssert((size_t)type < GR_ARRAY_COUNT(gPrimitiveType2GLMode));
GrGLvoid* indices = (GrGLvoid*)(sizeof(uint16_t) * startIndex);
@@ -1433,9 +1433,9 @@
#endif
}
-void GrGpuGL::onDrawNonIndexed(GrPrimitiveType type,
- uint32_t startVertex,
- uint32_t vertexCount) {
+void GrGpuGL::onGpuDrawNonIndexed(GrPrimitiveType type,
+ uint32_t startVertex,
+ uint32_t vertexCount) {
GrAssert((size_t)type < GR_ARRAY_COUNT(gPrimitiveType2GLMode));
GrAssert(NULL != fHWGeometryState.fVertexBuffer);
@@ -1924,7 +1924,7 @@
}
void GrGpuGL::notifyIndexBufferBind(const GrGLIndexBuffer* buffer) {
- fGeometrySrc.fIndexBuffer = buffer;
+ fHWGeometryState.fIndexBuffer = buffer;
}
void GrGpuGL::notifyIndexBufferDelete(const GrGLIndexBuffer* buffer) {
@@ -2058,17 +2058,19 @@
GrAssert(NULL != extraVertexOffset);
+ const GeometryPoolState& geoPoolState = this->getGeomPoolState();
+
GrGLVertexBuffer* vbuf;
- switch (fGeometrySrc.fVertexSrc) {
+ switch (this->getGeomSrc().fVertexSrc) {
case kBuffer_GeometrySrcType:
*extraVertexOffset = 0;
- vbuf = (GrGLVertexBuffer*) fGeometrySrc.fVertexBuffer;
+ vbuf = (GrGLVertexBuffer*) this->getGeomSrc().fVertexBuffer;
break;
case kArray_GeometrySrcType:
case kReserved_GeometrySrcType:
- finalizeReservedVertices();
- *extraVertexOffset = fCurrPoolStartVertex;
- vbuf = (GrGLVertexBuffer*) fCurrPoolVertexBuffer;
+ this->finalizeReservedVertices();
+ *extraVertexOffset = geoPoolState.fPoolStartVertex;
+ vbuf = (GrGLVertexBuffer*) geoPoolState.fPoolVertexBuffer;
break;
default:
vbuf = NULL; // suppress warning
@@ -2087,16 +2089,16 @@
GrAssert(NULL != extraIndexOffset);
GrGLIndexBuffer* ibuf;
- switch (fGeometrySrc.fIndexSrc) {
+ switch (this->getGeomSrc().fIndexSrc) {
case kBuffer_GeometrySrcType:
*extraIndexOffset = 0;
- ibuf = (GrGLIndexBuffer*)fGeometrySrc.fIndexBuffer;
+ ibuf = (GrGLIndexBuffer*)this->getGeomSrc().fIndexBuffer;
break;
case kArray_GeometrySrcType:
case kReserved_GeometrySrcType:
- finalizeReservedIndices();
- *extraIndexOffset = fCurrPoolStartIndex;
- ibuf = (GrGLIndexBuffer*) fCurrPoolIndexBuffer;
+ this->finalizeReservedIndices();
+ *extraIndexOffset = geoPoolState.fPoolStartIndex;
+ ibuf = (GrGLIndexBuffer*) geoPoolState.fPoolIndexBuffer;
break;
default:
ibuf = NULL; // suppress warning
« no previous file with comments | « gpu/src/GrGpuGL.h ('k') | gpu/src/GrGpuGLFixed.cpp » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b