Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Unified Diff: src/gpu/gl/GrGpuGL_program.cpp

Issue 707953004: cleaning up geometry handling in gpu (Closed) Base URL: https://skia.googlesource.com/skia.git@solo_gpu
Patch Set: rebase try 2 Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGpuGL.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGpuGL_program.cpp
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index 60692f8fe3ed19dbd79a7ddcb562a6f1c5b8ea11..b197dc9caa0bf91674cfd916fd14fc14b272e964 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -277,22 +277,8 @@ void GrGpuGL::setupGeometry(const GrDrawTarget::DrawInfo& info, size_t* indexOff
size_t vertexOffsetInBytes = stride * info.startVertex();
- const GeometryPoolState& geoPoolState = this->getGeomPoolState();
-
GrGLVertexBuffer* vbuf;
- switch (this->getGeomSrc().fVertexSrc) {
- case GrDrawTarget::kBuffer_GeometrySrcType:
- vbuf = (GrGLVertexBuffer*) this->getGeomSrc().fVertexBuffer;
- break;
- case GrDrawTarget::kReserved_GeometrySrcType:
- this->finalizeReservedVertices();
- vertexOffsetInBytes += geoPoolState.fPoolStartVertex * this->getGeomSrc().fVertexSize;
- vbuf = (GrGLVertexBuffer*) geoPoolState.fPoolVertexBuffer;
- break;
- default:
- vbuf = NULL; // suppress warning
- SkFAIL("Unknown geometry src type!");
- }
+ vbuf = (GrGLVertexBuffer*) this->getGeomSrc().fVertexBuffer;
SkASSERT(vbuf);
SkASSERT(!vbuf->isMapped());
@@ -302,20 +288,8 @@ void GrGpuGL::setupGeometry(const GrDrawTarget::DrawInfo& info, size_t* indexOff
if (info.isIndexed()) {
SkASSERT(indexOffsetInBytes);
- switch (this->getGeomSrc().fIndexSrc) {
- case GrDrawTarget::kBuffer_GeometrySrcType:
- *indexOffsetInBytes = 0;
- ibuf = (GrGLIndexBuffer*)this->getGeomSrc().fIndexBuffer;
- break;
- case GrDrawTarget::kReserved_GeometrySrcType:
- this->finalizeReservedIndices();
- *indexOffsetInBytes = geoPoolState.fPoolStartIndex * sizeof(GrGLushort);
- ibuf = (GrGLIndexBuffer*) geoPoolState.fPoolIndexBuffer;
- break;
- default:
- ibuf = NULL; // suppress warning
- SkFAIL("Unknown geometry src type!");
- }
+ *indexOffsetInBytes = 0;
+ ibuf = (GrGLIndexBuffer*)this->getGeomSrc().fIndexBuffer;
SkASSERT(ibuf);
SkASSERT(!ibuf->isMapped());
« no previous file with comments | « src/gpu/gl/GrGpuGL.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698