| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GLInstancedRendering.h" | 8 #include "GLInstancedRendering.h" |
| 9 | 9 |
| 10 #include "GrResourceProvider.h" | 10 #include "GrResourceProvider.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 197 |
| 198 SkASSERT(glInstancesIdx == numGLInstances); | 198 SkASSERT(glInstancesIdx == numGLInstances); |
| 199 fInstanceBuffer->unmap(); | 199 fInstanceBuffer->unmap(); |
| 200 } | 200 } |
| 201 | 201 |
| 202 void GLInstancedRendering::onDraw(const GrPipeline& pipeline, const InstanceProc
essor& instProc, | 202 void GLInstancedRendering::onDraw(const GrPipeline& pipeline, const InstanceProc
essor& instProc, |
| 203 const Batch* baseBatch) { | 203 const Batch* baseBatch) { |
| 204 if (!fDrawIndirectBuffer && !fGLDrawCmdsInfo) { | 204 if (!fDrawIndirectBuffer && !fGLDrawCmdsInfo) { |
| 205 return; // beginFlush was not successful. | 205 return; // beginFlush was not successful. |
| 206 } | 206 } |
| 207 if (!this->glGpu()->flushGLState(pipeline, instProc)) { | 207 if (!this->glGpu()->flushGLState(pipeline, instProc, false)) { |
| 208 return; | 208 return; |
| 209 } | 209 } |
| 210 | 210 |
| 211 if (fDrawIndirectBuffer) { | 211 if (fDrawIndirectBuffer) { |
| 212 this->glGpu()->bindBuffer(kDrawIndirect_GrBufferType, fDrawIndirectBuffe
r.get()); | 212 this->glGpu()->bindBuffer(kDrawIndirect_GrBufferType, fDrawIndirectBuffe
r.get()); |
| 213 } | 213 } |
| 214 | 214 |
| 215 const GrGLCaps& glCaps = this->glGpu()->glCaps(); | 215 const GrGLCaps& glCaps = this->glGpu()->glCaps(); |
| 216 const GLBatch* batch = static_cast<const GLBatch*>(baseBatch); | 216 const GLBatch* batch = static_cast<const GLBatch*>(baseBatch); |
| 217 int numCommands = batch->numGLCommands(); | 217 int numCommands = batch->numGLCommands(); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 GL_CALL(DeleteVertexArrays(1, &fVertexArrayID)); | 315 GL_CALL(DeleteVertexArrays(1, &fVertexArrayID)); |
| 316 this->glGpu()->notifyVertexArrayDelete(fVertexArrayID); | 316 this->glGpu()->notifyVertexArrayDelete(fVertexArrayID); |
| 317 } | 317 } |
| 318 fVertexArrayID = 0; | 318 fVertexArrayID = 0; |
| 319 fInstanceBuffer.reset(); | 319 fInstanceBuffer.reset(); |
| 320 fDrawIndirectBuffer.reset(); | 320 fDrawIndirectBuffer.reset(); |
| 321 fInstanceAttribsBufferUniqueId = SK_InvalidUniqueID; | 321 fInstanceAttribsBufferUniqueId = SK_InvalidUniqueID; |
| 322 } | 322 } |
| 323 | 323 |
| 324 } | 324 } |
| OLD | NEW |