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 <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp
index b4c0c52..a856ba6 100644
--- a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp
@@ -746,12 +746,12 @@
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 @@
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);