Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(600)

Unified Diff: src/gpu/gl/GrGLInstancedRendering.h

Issue 1897203002: Implement instanced rendering for simple shapes (Closed) Base URL: https://skia.googlesource.com/skia.git@upload2_requireHWAA
Patch Set: comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/gl/GrGLInstancedRendering.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/gl/GrGLInstancedRendering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698