Index: src/gpu/gl/GrGLInstancedRendering.h |
diff --git a/src/gpu/gl/GrGLInstancedRendering.h b/src/gpu/gl/GrGLInstancedRendering.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..748494b7048c4a52893425b4c083e09017ad4b93 |
--- /dev/null |
+++ b/src/gpu/gl/GrGLInstancedRendering.h |
@@ -0,0 +1,45 @@ |
+/* |
+ * Copyright 2016 Google Inc. |
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+#ifndef GrGLInstancedRendering_DEFINED |
+#define GrGLInstancedRendering_DEFINED |
+ |
+#include "GrInstancedRendering.h" |
+#include "gl/GrGLFunctions.h" |
+ |
+class GrGLGpu; |
+ |
+class GrGLInstancedRendering final : public GrInstancedRendering { |
+public: |
+ static GrGLInstancedRendering* CreateIfSupported(GrGLGpu*); |
+ ~GrGLInstancedRendering() override; |
+ |
+private: |
+ GrGLInstancedRendering(GrGLGpu*, uint32_t supportedAAModes); |
+ |
+ GrGLGpu* glGpu() const; |
+ |
+ Batch* constructBatch(void* storage, int instanceIdx) override; |
+ |
+ void onBeginFlush(GrResourceProvider*) override; |
+ void onDraw(const GrPipeline&, const GrInstanceProcessor&, const Batch*) override; |
+ void onEndFlush() override; |
+ void onResetGpuResources(ResetType) override; |
+ |
+ void flushAttribArrays(); |
+ |
+ GrGLuint fVertexArrayID; |
+ uint32_t fInstanceBufferInVertexArrayID; |
+ int fTotalDrawCmdCount; |
+ SkAutoTUnref<GrBuffer> fDrawIndirectBuffer; |
+ |
+ class GLBatch; |
+ |
+ typedef GrInstancedRendering INHERITED; |
+}; |
+ |
+#endif |