diff options
author | Chris Dalton <csmartdalton@google.com> | 2017-05-15 11:03:26 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-15 18:01:59 +0000 |
commit | bca46e29e9f96999df0b38fb9359e71b73217c94 (patch) | |
tree | 0bd487809346776fccfee12540968cb23aa6cb7a /src/gpu/GrGpuCommandBuffer.cpp | |
parent | 18e9484ad5b5755757dc6badb986017a088a9c6b (diff) |
Convert GrMesh back to a class
Specific methods that limit the data to valid configurations are better
than a runtime mega-assert.
Bug: skia:
Change-Id: Ie15f2dc79659e44cfaddd16eb474795b110fda73
Reviewed-on: https://skia-review.googlesource.com/16577
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrGpuCommandBuffer.cpp')
-rw-r--r-- | src/gpu/GrGpuCommandBuffer.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gpu/GrGpuCommandBuffer.cpp b/src/gpu/GrGpuCommandBuffer.cpp index a57a13fda6..ee7414eafc 100644 --- a/src/gpu/GrGpuCommandBuffer.cpp +++ b/src/gpu/GrGpuCommandBuffer.cpp @@ -37,10 +37,15 @@ void GrGpuCommandBuffer::clearStencilClip(GrRenderTarget* rt, const GrFixedClip& bool GrGpuCommandBuffer::draw(const GrPipeline& pipeline, const GrPrimitiveProcessor& primProc, - const GrMesh* mesh, + const GrMesh meshes[], int meshCount, const SkRect& bounds) { - SkDEBUGCODE(mesh->validate()); +#ifdef SK_DEBUG + for (int i = 0; i < meshCount; ++i) { + SkASSERT(SkToBool(primProc.numAttribs()) == SkToBool(meshes[i].vertexBuffer())); + } +#endif + if (pipeline.isBad() || primProc.isBad()) { return false; } @@ -50,7 +55,7 @@ bool GrGpuCommandBuffer::draw(const GrPipeline& pipeline, this->gpu()->stats()->incNumFailedDraws(); return false; } - this->onDraw(pipeline, primProc, mesh, meshCount, bounds); + this->onDraw(pipeline, primProc, meshes, meshCount, bounds); return true; } |