diff options
author | joshualitt <joshualitt@chromium.org> | 2014-11-07 08:48:51 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-07 08:48:51 -0800 |
commit | 3322fa432a96fdc94d54f2475faf918dfa05b919 (patch) | |
tree | c084b0a4fac874d37ace3dd0c682a2304e6b6f3a /src/gpu/gl | |
parent | 6f1cad40307eb345c8a60072803d1b8af872b147 (diff) |
Refactor DrawTarget and GPU to be independent
BUG=skia:
Review URL: https://codereview.chromium.org/705593002
Diffstat (limited to 'src/gpu/gl')
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL.h | 4 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL_program.cpp | 10 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index 73dd9bb15c..665785c53c 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -1731,7 +1731,7 @@ GrGLenum gPrimitiveType2GLMode[] = { #endif #endif -void GrGpuGL::onGpuDraw(const DrawInfo& info) { +void GrGpuGL::onGpuDraw(const GrDrawTarget::DrawInfo& info) { size_t indexOffsetInBytes; this->setupGeometry(info, &indexOffsetInBytes); diff --git a/src/gpu/gl/GrGpuGL.h b/src/gpu/gl/GrGpuGL.h index 9a491906ba..bba6400f46 100644 --- a/src/gpu/gl/GrGpuGL.h +++ b/src/gpu/gl/GrGpuGL.h @@ -153,7 +153,7 @@ private: virtual void onResolveRenderTarget(GrRenderTarget* target) SK_OVERRIDE; - virtual void onGpuDraw(const DrawInfo&) SK_OVERRIDE; + virtual void onGpuDraw(const GrDrawTarget::DrawInfo&) SK_OVERRIDE; virtual void clearStencil(GrRenderTarget*) SK_OVERRIDE; @@ -171,7 +171,7 @@ private: // Sets up vertex attribute pointers and strides. On return indexOffsetInBytes gives the offset // an into the index buffer. It does not account for drawInfo.startIndex() but rather the start // index is relative to the returned offset. - void setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes); + void setupGeometry(const GrDrawTarget::DrawInfo& info, size_t* indexOffsetInBytes); // Subclasses should call this to flush the blend state. // The params should be the final coefficients to apply diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp index 96ad411fc7..60692f8fe3 100644 --- a/src/gpu/gl/GrGpuGL_program.cpp +++ b/src/gpu/gl/GrGpuGL_program.cpp @@ -264,7 +264,7 @@ bool GrGpuGL::flushGraphicsState(DrawType type, return true; } -void GrGpuGL::setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes) { +void GrGpuGL::setupGeometry(const GrDrawTarget::DrawInfo& info, size_t* indexOffsetInBytes) { SkAutoTUnref<GrOptDrawState> optState( GrOptDrawState::Create(this->getDrawState(), this, info.getDstCopy(), PrimTypeToDrawType(info.primitiveType()))); @@ -281,10 +281,10 @@ void GrGpuGL::setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes) { GrGLVertexBuffer* vbuf; switch (this->getGeomSrc().fVertexSrc) { - case kBuffer_GeometrySrcType: + case GrDrawTarget::kBuffer_GeometrySrcType: vbuf = (GrGLVertexBuffer*) this->getGeomSrc().fVertexBuffer; break; - case kReserved_GeometrySrcType: + case GrDrawTarget::kReserved_GeometrySrcType: this->finalizeReservedVertices(); vertexOffsetInBytes += geoPoolState.fPoolStartVertex * this->getGeomSrc().fVertexSize; vbuf = (GrGLVertexBuffer*) geoPoolState.fPoolVertexBuffer; @@ -303,11 +303,11 @@ void GrGpuGL::setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes) { SkASSERT(indexOffsetInBytes); switch (this->getGeomSrc().fIndexSrc) { - case kBuffer_GeometrySrcType: + case GrDrawTarget::kBuffer_GeometrySrcType: *indexOffsetInBytes = 0; ibuf = (GrGLIndexBuffer*)this->getGeomSrc().fIndexBuffer; break; - case kReserved_GeometrySrcType: + case GrDrawTarget::kReserved_GeometrySrcType: this->finalizeReservedIndices(); *indexOffsetInBytes = geoPoolState.fPoolStartIndex * sizeof(GrGLushort); ibuf = (GrGLIndexBuffer*) geoPoolState.fPoolIndexBuffer; |