From e3302dfb81865051ad19cd1c91e2ec3a27df3417 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Mon, 24 Apr 2017 07:31:02 -0400 Subject: 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 Reviewed-by: Chris Dalton --- src/gpu/GrDrawingManager.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/gpu/GrDrawingManager.h') diff --git a/src/gpu/GrDrawingManager.h b/src/gpu/GrDrawingManager.h index d68430ecd2..e96fd3a5f8 100644 --- a/src/gpu/GrDrawingManager.h +++ b/src/gpu/GrDrawingManager.h @@ -15,6 +15,7 @@ #include "GrRenderTargetOpList.h" #include "GrResourceCache.h" #include "SkTArray.h" +#include "instanced/InstancedRendering.h" #include "text/GrAtlasTextContext.h" class GrContext; @@ -37,6 +38,8 @@ public: bool wasAbandoned() const { return fAbandoned; } void freeGpuResources(); + gr_instanced::OpAllocator* instancingAllocator(); + sk_sp makeRenderTargetContext(sk_sp, sk_sp, const SkSurfaceProps*); @@ -124,6 +127,9 @@ private: bool fIsImmediateMode; SkTArray> fPreFlushCBObjects; + + // Lazily allocated + std::unique_ptr fInstancingAllocator; }; #endif -- cgit v1.2.3