OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2016 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef GrGLInstancedRendering_DEFINED |
| 9 #define GrGLInstancedRendering_DEFINED |
| 10 |
| 11 #include "GrInstancedRendering.h" |
| 12 #include "gl/GrGLFunctions.h" |
| 13 |
| 14 class GrGLGpu; |
| 15 |
| 16 class GrGLInstancedRendering final : public GrInstancedRendering { |
| 17 public: |
| 18 static GrGLInstancedRendering* CreateIfSupported(GrGLGpu*); |
| 19 ~GrGLInstancedRendering() override; |
| 20 |
| 21 private: |
| 22 GrGLInstancedRendering(GrGLGpu*, uint32_t supportedAAModes); |
| 23 |
| 24 GrGLGpu* glGpu() const; |
| 25 |
| 26 Batch* constructBatch(void* storage, int instanceIdx) override; |
| 27 |
| 28 void onBeginFlush(GrResourceProvider*) override; |
| 29 void onDraw(const GrPipeline&, const GrInstanceProcessor&, const Batch*) ove
rride; |
| 30 void onEndFlush() override; |
| 31 void onResetGpuResources(ResetType) override; |
| 32 |
| 33 void flushAttribArrays(); |
| 34 |
| 35 GrGLuint fVertexArrayID; |
| 36 uint32_t fInstanceBufferInVertexArrayID; |
| 37 int fTotalDrawCmdCount; |
| 38 SkAutoTUnref<GrBuffer> fDrawIndirectBuffer; |
| 39 |
| 40 class GLBatch; |
| 41 |
| 42 typedef GrInstancedRendering INHERITED; |
| 43 }; |
| 44 |
| 45 #endif |
OLD | NEW |