aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/instanced/GLInstancedRendering.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-04-24 07:31:02 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-24 12:13:16 +0000
commite3302dfb81865051ad19cd1c91e2ec3a27df3417 (patch)
tree61d6c53ce21f75f6f5f46e24f160760985366e10 /src/gpu/instanced/GLInstancedRendering.h
parent96a533051fc71b5ba8ddfaf01498894feed29847 (diff)
Make InstancedRendering more opList-splitting friendly
This CL splits the InstancedRendering class into an allocator and a per-opList op tracker. This was done because we need to allocate the InstancedRendering ops before we know the final destination opList. The InstancedRendering ops are now still all allocated from the same pool but the tracking and execution is done per opList. Change-Id: Ieddabb6f85f8f187c5e7373f7f6cb155d69a9685 Reviewed-on: https://skia-review.googlesource.com/13860 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/instanced/GLInstancedRendering.h')
-rw-r--r--src/gpu/instanced/GLInstancedRendering.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gpu/instanced/GLInstancedRendering.h b/src/gpu/instanced/GLInstancedRendering.h
index d1affba2bd..d68bc86cde 100644
--- a/src/gpu/instanced/GLInstancedRendering.h
+++ b/src/gpu/instanced/GLInstancedRendering.h
@@ -10,6 +10,7 @@
#include "GrCaps.h"
#include "gl/GrGLBuffer.h"
+#include "instanced/InstancedOp.h"
#include "instanced/InstancedRendering.h"
class GrGLCaps;
@@ -19,6 +20,16 @@ class GrGLGpu;
namespace gr_instanced {
+class GLOpAllocator final : public OpAllocator {
+public:
+ GLOpAllocator(const GrCaps* caps) : INHERITED(caps) {}
+
+private:
+ std::unique_ptr<InstancedOp> makeOp(GrPaint&& paint) override;
+
+ typedef OpAllocator INHERITED;
+};
+
class GLInstancedRendering final : public InstancedRendering {
public:
GLInstancedRendering(GrGLGpu*);
@@ -33,10 +44,8 @@ private:
GrGLGpu* glGpu() const;
- std::unique_ptr<Op> makeOp(GrPaint&& paint) override;
-
void onBeginFlush(GrResourceProvider*) override;
- void onDraw(const GrPipeline&, const InstanceProcessor&, const Op*) override;
+ void onDraw(const GrPipeline&, const InstanceProcessor&, const InstancedOp*) override;
void onEndFlush() override;
void onResetGpuResources(ResetType) override;
@@ -54,8 +63,6 @@ private:
GrGpuResource::UniqueID fInstanceAttribsBufferUniqueId;
int fInstanceAttribsBaseInstance;
- class GLOp;
-
friend class ::GrGLCaps; // For CheckSupport.
typedef InstancedRendering INHERITED;