| 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 #ifndef gr_instanced_GLInstancedRendering_DEFINED | 8 #ifndef gr_instanced_GLInstancedRendering_DEFINED |
| 9 #define gr_instanced_GLInstancedRendering_DEFINED | 9 #define gr_instanced_GLInstancedRendering_DEFINED |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 Batch* createBatch() override; | 36 Batch* createBatch() override; |
| 37 | 37 |
| 38 void onBeginFlush(GrResourceProvider*) override; | 38 void onBeginFlush(GrResourceProvider*) override; |
| 39 void onDraw(const GrPipeline&, const InstanceProcessor&, const Batch*) overr
ide; | 39 void onDraw(const GrPipeline&, const InstanceProcessor&, const Batch*) overr
ide; |
| 40 void onEndFlush() override; | 40 void onEndFlush() override; |
| 41 void onResetGpuResources(ResetType) override; | 41 void onResetGpuResources(ResetType) override; |
| 42 | 42 |
| 43 void flushInstanceAttribs(int baseInstance); | 43 void flushInstanceAttribs(int baseInstance); |
| 44 | 44 |
| 45 struct GLDrawCmdInfo { | 45 struct GLDrawCmdInfo { |
| 46 IndexRange fGeometry; |
| 46 int fInstanceCount; | 47 int fInstanceCount; |
| 47 #if GR_GL_LOG_INSTANCED_BATCHES | |
| 48 IndexRange fGeometry; | |
| 49 #endif | |
| 50 }; | 48 }; |
| 51 | 49 |
| 52 GrGLuint fVertexArrayID; | 50 GrGLuint fVertexArrayID; |
| 53 SkAutoTUnref<GrBuffer> fInstanceBuffer; | 51 SkAutoTUnref<GrBuffer> fInstanceBuffer; |
| 54 SkAutoTUnref<GrBuffer> fDrawIndirectBuffer; | 52 SkAutoTUnref<GrBuffer> fDrawIndirectBuffer; |
| 55 SkAutoSTMalloc<1024, GLDrawCmdInfo> fGLDrawCmdsInfo; | 53 SkAutoSTMalloc<1024, GLDrawCmdInfo> fGLDrawCmdsInfo; |
| 56 uint32_t fInstanceAttribsBufferUniqueId; | 54 uint32_t fInstanceAttribsBufferUniqueId; |
| 57 int fInstanceAttribsBaseInstance; | 55 int fInstanceAttribsBaseInstance; |
| 58 | 56 |
| 59 class GLBatch; | 57 class GLBatch; |
| 60 | 58 |
| 61 friend class ::GrGLCaps; // For CheckSupport. | 59 friend class ::GrGLCaps; // For CheckSupport. |
| 62 | 60 |
| 63 typedef InstancedRendering INHERITED; | 61 typedef InstancedRendering INHERITED; |
| 64 }; | 62 }; |
| 65 | 63 |
| 66 } | 64 } |
| 67 | 65 |
| 68 #endif | 66 #endif |
| OLD | NEW |