| Index: src/gpu/instanced/GLInstancedRendering.h
|
| diff --git a/src/gpu/instanced/GLInstancedRendering.h b/src/gpu/instanced/GLInstancedRendering.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..fc6f5c99151f28eb2858c8baa157c1642160d32f
|
| --- /dev/null
|
| +++ b/src/gpu/instanced/GLInstancedRendering.h
|
| @@ -0,0 +1,55 @@
|
| +/*
|
| + * 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 gr_instanced_GLInstancedRendering_DEFINED
|
| +#define gr_instanced_GLInstancedRendering_DEFINED
|
| +
|
| +#include "gl/GrGLBuffer.h"
|
| +#include "instanced/InstancedRendering.h"
|
| +
|
| +class GrGLGpu;
|
| +
|
| +namespace gr_instanced {
|
| +
|
| +class GLInstancedRendering final : public InstancedRendering {
|
| +public:
|
| + static GLInstancedRendering* CreateIfSupported(GrGLGpu*);
|
| + ~GLInstancedRendering() override;
|
| +
|
| +private:
|
| + GLInstancedRendering(GrGLGpu*, AntialiasMode lastSupportedAAMode);
|
| +
|
| + GrGLGpu* glGpu() const;
|
| +
|
| + Batch* createBatch(int instanceIdx) override;
|
| +
|
| + void onBeginFlush(GrResourceProvider*) override;
|
| + void onDraw(const GrPipeline&, const InstanceProcessor&, const Batch*) override;
|
| + void onEndFlush() override;
|
| + void onResetGpuResources(ResetType) override;
|
| +
|
| + void flushInstanceAttribs(int baseInstance);
|
| +
|
| + struct GLDrawCmdInfo {
|
| + int fInstanceCount;
|
| + };
|
| +
|
| + GrGLuint fVertexArrayID;
|
| + SkAutoTUnref<GrGLBuffer> fInstanceBuffer;
|
| + SkAutoTUnref<GrGLBuffer> fDrawIndirectBuffer;
|
| + SkAutoSTMalloc<1024, GLDrawCmdInfo> fGLDrawCmdsInfo;
|
| + uint32_t fInstanceAttribsBufferUniqueId;
|
| + int fInstanceAttribsBaseInstance;
|
| +
|
| + class GLBatch;
|
| +
|
| + typedef InstancedRendering INHERITED;
|
| +};
|
| +
|
| +}
|
| +
|
| +#endif
|
|
|