diff options
author | Robert Phillips <robertphillips@google.com> | 2018-06-14 14:31:17 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-15 11:33:14 +0000 |
commit | c8cee446bf9c07da8848bbd032abf26e79966ac1 (patch) | |
tree | 5f024f9dfb1aca470915da9fae96eac0710f5884 /include | |
parent | 9e6402677f1c8f2c3bdc3b812ee38ea2931d92b3 (diff) |
Move op memory storage to GrContext
TBR=bsalomon@google.com
Change-Id: Ifa95bf0073b9d948f2c937d10088b7734b971f90
Reviewed-on: https://skia-review.googlesource.com/131500
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/atlastext/SkAtlasTextTarget.h | 4 | ||||
-rw-r--r-- | include/gpu/GrContext.h | 3 | ||||
-rw-r--r-- | include/private/GrCCPerOpListPaths.h | 2 | ||||
-rw-r--r-- | include/private/GrOpList.h | 17 |
4 files changed, 18 insertions, 8 deletions
diff --git a/include/atlastext/SkAtlasTextTarget.h b/include/atlastext/SkAtlasTextTarget.h index c29f381dc8..7e4ae449ed 100644 --- a/include/atlastext/SkAtlasTextTarget.h +++ b/include/atlastext/SkAtlasTextTarget.h @@ -27,7 +27,9 @@ public: * Creates a text drawing target. ‘handle’ is used to identify this rendering surface when * draws are flushed to the SkAtlasTextContext's SkAtlasTextRenderer. */ - static std::unique_ptr<SkAtlasTextTarget> Make(sk_sp<SkAtlasTextContext>, int width, int height, + static std::unique_ptr<SkAtlasTextTarget> Make(sk_sp<SkAtlasTextContext>, + int width, + int height, void* handle); /** diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index 5a2ba4780f..517e23a627 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -33,6 +33,7 @@ class GrGlyphCache; class GrGpu; class GrIndexBuffer; struct GrMockOptions; +class GrOpMemoryPool; class GrOvalRenderer; class GrPath; class GrProxyProvider; @@ -307,6 +308,8 @@ private: GrProxyProvider* fProxyProvider; std::unique_ptr<GrTextureStripAtlasManager> fTextureStripAtlasManager; + // All the GrOp-derived classes use this pool. + sk_sp<GrOpMemoryPool> fOpMemoryPool; GrGlyphCache* fGlyphCache; std::unique_ptr<GrTextBlobCache> fTextBlobCache; diff --git a/include/private/GrCCPerOpListPaths.h b/include/private/GrCCPerOpListPaths.h index b94e82c548..6e53a1ff5c 100644 --- a/include/private/GrCCPerOpListPaths.h +++ b/include/private/GrCCPerOpListPaths.h @@ -25,7 +25,7 @@ class GrCCPerOpListPaths : public SkRefCnt { public: ~GrCCPerOpListPaths(); - SkTInternalLList<GrCCDrawPathsOp> fDrawOps; + SkTInternalLList<GrCCDrawPathsOp> fDrawOps; // This class does not own these ops. std::map<uint32_t, GrCCClipPath> fClipPaths; SkSTArenaAlloc<10 * 1024> fAllocator{10 * 1024 * 2}; sk_sp<const GrCCPerFlushResources> fFlushResources; diff --git a/include/private/GrOpList.h b/include/private/GrOpList.h index 846a5834f7..0d5a1a245a 100644 --- a/include/private/GrOpList.h +++ b/include/private/GrOpList.h @@ -17,6 +17,7 @@ class GrAuditTrail; class GrCaps; class GrOpFlushState; +class GrOpMemoryPool; class GrRenderTargetOpList; class GrResourceAllocator; class GrResourceProvider; @@ -28,7 +29,7 @@ struct SkIRect; class GrOpList : public SkRefCnt { public: - GrOpList(GrResourceProvider*, GrSurfaceProxy*, GrAuditTrail*); + GrOpList(GrResourceProvider*, sk_sp<GrOpMemoryPool>, GrSurfaceProxy*, GrAuditTrail*); ~GrOpList() override; // These four methods are invoked at flush time @@ -102,12 +103,16 @@ public: protected: bool isInstantiated() const; - GrSurfaceProxyRef fTarget; - GrAuditTrail* fAuditTrail; + // This is a backpointer to the GrOpMemoryPool that holds the memory for this opLists' ops. + // In the DDL case, these back pointers keep the DDL's GrOpMemoryPool alive as long as its + // constituent opLists survive. + sk_sp<GrOpMemoryPool> fOpMemoryPool; + GrSurfaceProxyRef fTarget; + GrAuditTrail* fAuditTrail; - GrLoadOp fColorLoadOp = GrLoadOp::kLoad; - GrColor fLoadClearColor = 0x0; - GrLoadOp fStencilLoadOp = GrLoadOp::kLoad; + GrLoadOp fColorLoadOp = GrLoadOp::kLoad; + GrColor fLoadClearColor = 0x0; + GrLoadOp fStencilLoadOp = GrLoadOp::kLoad; // List of texture proxies whose contents are being prepared on a worker thread SkTArray<GrTextureProxy*, true> fDeferredProxies; |