From 256c37bc9ea2a0420b8ac1084f6d645aaeb919f0 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Wed, 1 Mar 2017 14:32:46 -0500 Subject: Remove atlas creation from GrResourceProvider This is pulled out of: https://skia-review.googlesource.com/c/6680/ (Make SkImage_Gpu be deferred) and is only tangentially related to the goal of that CL. Change-Id: I6b6db4869597070f85ab3b9fea178fc88c104f87 Reviewed-on: https://skia-review.googlesource.com/9106 Reviewed-by: Brian Salomon Commit-Queue: Robert Phillips --- src/gpu/ops/GrAADistanceFieldPathRenderer.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/gpu/ops/GrAADistanceFieldPathRenderer.cpp') diff --git a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp index b4c0c526fb..a856ba6f58 100644 --- a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp +++ b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp @@ -746,12 +746,12 @@ bool GrAADistanceFieldPathRenderer::onDrawPath(const DrawPathArgs& args) { SkASSERT(!args.fShape->isEmpty()); SkASSERT(args.fShape->hasUnstyledKey()); if (!fAtlas) { - fAtlas = args.fResourceProvider->makeAtlas(args.fResourceProvider->context(), - kAlpha_8_GrPixelConfig, - ATLAS_TEXTURE_WIDTH, ATLAS_TEXTURE_HEIGHT, - NUM_PLOTS_X, NUM_PLOTS_Y, - &GrAADistanceFieldPathRenderer::HandleEviction, - (void*)this); + fAtlas = GrDrawOpAtlas::Make(args.fContext, + kAlpha_8_GrPixelConfig, + ATLAS_TEXTURE_WIDTH, ATLAS_TEXTURE_HEIGHT, + NUM_PLOTS_X, NUM_PLOTS_Y, + &GrAADistanceFieldPathRenderer::HandleEviction, + (void*)this); if (!fAtlas) { return false; } @@ -820,12 +820,11 @@ DRAW_OP_TEST_DEFINE(AADistanceFieldPathOp) { if (context->uniqueID() != gTestStruct.fContextID) { gTestStruct.fContextID = context->uniqueID(); gTestStruct.reset(); - gTestStruct.fAtlas = - context->resourceProvider()->makeAtlas(context, kAlpha_8_GrPixelConfig, - ATLAS_TEXTURE_WIDTH, ATLAS_TEXTURE_HEIGHT, - NUM_PLOTS_X, NUM_PLOTS_Y, - &PathTestStruct::HandleEviction, - (void*)&gTestStruct); + gTestStruct.fAtlas = GrDrawOpAtlas::Make(context, kAlpha_8_GrPixelConfig, + ATLAS_TEXTURE_WIDTH, ATLAS_TEXTURE_HEIGHT, + NUM_PLOTS_X, NUM_PLOTS_Y, + &PathTestStruct::HandleEviction, + (void*)&gTestStruct); } SkMatrix viewMatrix = GrTest::TestMatrix(random); -- cgit v1.2.3