From c994a93b327235182c6d29a782c409b2c58476ae Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Tue, 19 Jun 2018 13:09:54 -0400 Subject: 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 Reviewed-by: Brian Salomon Commit-Queue: Robert Phillips --- src/gpu/ops/GrAtlasTextOp.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/gpu/ops/GrAtlasTextOp.cpp') diff --git a/src/gpu/ops/GrAtlasTextOp.cpp b/src/gpu/ops/GrAtlasTextOp.cpp index eb39079423..1ea3ddfae6 100644 --- a/src/gpu/ops/GrAtlasTextOp.cpp +++ b/src/gpu/ops/GrAtlasTextOp.cpp @@ -8,6 +8,7 @@ #include "GrAtlasTextOp.h" #include "GrContext.h" +#include "GrContextPriv.h" #include "GrMemoryPool.h" #include "GrOpFlushState.h" #include "GrResourceProvider.h" @@ -27,7 +28,9 @@ std::unique_ptr GrAtlasTextOp::MakeBitmap(GrContext* context, GrMaskFormat maskFormat, int glyphCount, bool needsTransform) { - std::unique_ptr op(new GrAtlasTextOp(std::move(paint))); + GrOpMemoryPool* pool = context->contextPriv().opMemoryPool(); + + std::unique_ptr op = pool->allocate(std::move(paint)); switch (maskFormat) { case kA8_GrMaskFormat: @@ -57,7 +60,9 @@ std::unique_ptr GrAtlasTextOp::MakeDistanceField( const SkSurfaceProps& props, bool isAntiAliased, bool useLCD) { - std::unique_ptr op(new GrAtlasTextOp(std::move(paint))); + GrOpMemoryPool* pool = context->contextPriv().opMemoryPool(); + + std::unique_ptr op = pool->allocate(std::move(paint)); bool isBGR = SkPixelGeometryIsBGR(props.pixelGeometry()); bool isLCD = useLCD && SkPixelGeometryIsH(props.pixelGeometry()); -- cgit v1.2.3