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

Side by Side Diff: src/gpu/instanced/GLInstancedRendering.h

Issue 2066993003: Begin instanced rendering for simple shapes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rix perf regressions Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/instanced/GLInstancedRendering.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 gr_instanced_GLInstancedRendering_DEFINED
9 #define gr_instanced_GLInstancedRendering_DEFINED
10
11 #include "gl/GrGLBuffer.h"
12 #include "instanced/InstancedRendering.h"
13
14 class GrGLGpu;
15
16 #define GR_GL_LOG_INSTANCED_BATCHES 0
17
18 namespace gr_instanced {
19
20 class GLInstancedRendering final : public InstancedRendering {
21 public:
22 static GLInstancedRendering* CreateIfSupported(GrGLGpu*);
23 ~GLInstancedRendering() override;
24
25 private:
26 GLInstancedRendering(GrGLGpu*, AntialiasMode lastSupportedAAMode);
27
28 GrGLGpu* glGpu() const;
29
30 Batch* createBatch() override;
31
32 void onBeginFlush(GrResourceProvider*) override;
33 void onDraw(const GrPipeline&, const InstanceProcessor&, const Batch*) overr ide;
34 void onEndFlush() override;
35 void onResetGpuResources(ResetType) override;
36
37 void flushInstanceAttribs(int baseInstance);
38
39 struct GLDrawCmdInfo {
40 int fInstanceCount;
41 #if GR_GL_LOG_INSTANCED_BATCHES
42 IndexRange fGeometry;
43 #endif
44 };
45
46 GrGLuint fVertexArrayID;
47 SkAutoTUnref<GrGLBuffer> fInstanceBuffer;
48 SkAutoTUnref<GrGLBuffer> fDrawIndirectBuffer;
49 SkAutoSTMalloc<1024, GLDrawCmdInfo> fGLDrawCmdsInfo;
50 uint32_t fInstanceAttribsBufferUniqueId;
51 int fInstanceAttribsBaseInstance;
52
53 class GLBatch;
54
55 typedef InstancedRendering INHERITED;
56 };
57
58 }
59
60 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/instanced/GLInstancedRendering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698