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

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: get mixed samples and base instance paths working again Created 4 years, 6 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
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 namespace gr_instanced {
17
18 class GLInstancedRendering final : public InstancedRendering {
19 public:
20 static GLInstancedRendering* CreateIfSupported(GrGLGpu*);
21 ~GLInstancedRendering() override;
22
23 private:
24 GLInstancedRendering(GrGLGpu*, AntialiasMode lastSupportedAAMode);
25
26 GrGLGpu* glGpu() const;
27
28 Batch* createBatch(int instanceIdx) override;
29
30 void onBeginFlush(GrResourceProvider*) override;
31 void onDraw(const GrPipeline&, const InstanceProcessor&, const Batch*) overr ide;
32 void onEndFlush() override;
33 void onResetGpuResources(ResetType) override;
34
35 void flushInstanceAttribs(int baseInstance);
36
37 struct GLDrawCmdInfo {
38 int fInstanceCount;
39 };
40
41 GrGLuint fVertexArrayID;
42 SkAutoTUnref<GrGLBuffer> fInstanceBuffer;
43 SkAutoTUnref<GrGLBuffer> fDrawIndirectBuffer;
44 SkAutoSTMalloc<1024, GLDrawCmdInfo> fGLDrawCmdsInfo;
45 uint32_t fInstanceAttribsBufferUniqueId;
46 int fInstanceAttribsBaseInstance;
47
48 class GLBatch;
49
50 typedef InstancedRendering INHERITED;
51 };
52
53 }
54
55 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698