diff options
author | 2018-06-19 13:09:54 -0400 | |
---|---|---|
committer | 2018-06-19 19:51:20 +0000 | |
commit | c994a93b327235182c6d29a782c409b2c58476ae (patch) | |
tree | dba9ab1ff4a414e76da883f47ee90acbf0f27868 /src/gpu/ccpr/GrCCPerFlushResources.cpp | |
parent | 4d75975b70c454288226afc03e512ad9bc2db5ac (diff) |
Move op memory storage to GrContext (take 2)
TBR=bsalomon@google.com
Change-Id: I4a448694d4114d83cd3a720cfc8bd37de51733d1
Reviewed-on: https://skia-review.googlesource.com/135707
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/ccpr/GrCCPerFlushResources.cpp')
-rw-r--r-- | src/gpu/ccpr/GrCCPerFlushResources.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gpu/ccpr/GrCCPerFlushResources.cpp b/src/gpu/ccpr/GrCCPerFlushResources.cpp index 84f905cbc6..a1cecb3f88 100644 --- a/src/gpu/ccpr/GrCCPerFlushResources.cpp +++ b/src/gpu/ccpr/GrCCPerFlushResources.cpp @@ -53,8 +53,10 @@ public: sk_sp<const GrCCPerFlushResources> resources, sk_sp<GrTextureProxy> copyProxy, int baseInstance, int endInstance, const SkISize& drawBounds) { - return std::unique_ptr<GrDrawOp>(new CopyAtlasOp(std::move(resources), std::move(copyProxy), - baseInstance, endInstance, drawBounds)); + GrOpMemoryPool* pool = context->contextPriv().opMemoryPool(); + + return pool->allocate<CopyAtlasOp>(std::move(resources), std::move(copyProxy), + baseInstance, endInstance, drawBounds); } const char* name() const override { return "CopyAtlasOp (CCPR)"; } @@ -96,8 +98,9 @@ public: static std::unique_ptr<GrDrawOp> Make(GrContext* context, sk_sp<const GrCCPerFlushResources> resources, CoverageCountBatchID batchID, const SkISize& drawBounds) { - return std::unique_ptr<GrDrawOp>(new RenderAtlasOp(std::move(resources), batchID, - drawBounds)); + GrOpMemoryPool* pool = context->contextPriv().opMemoryPool(); + + return pool->allocate<RenderAtlasOp>(std::move(resources), batchID, drawBounds); } // GrDrawOp interface. |