Begin switching GrRecordingContext over to having the GrDrawingManager
The change forces the GrDrawingManager to only being able to access a GrRecordingContext.
Note that, like the ProxyProvider, the drawingManager still behaves differently if it is being used to directly render. In this case, the biggest difference is that the flush methods are disabled when DDL recording.
This pulls as much as possible out of https://skia-review.googlesource.com/c/skia/+/191287 (Move DrawingManager to RecordingContext) while keeping the drawingManager in the GrContext.
Change-Id: I1e5305fe0cb17ee0b243bfb8622f652310fc0507
Reviewed-on: https://skia-review.googlesource.com/c/192881
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 7f7e4d4..1ccbc6b 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -55,8 +55,8 @@
GrContext::~GrContext() {
ASSERT_SINGLE_OWNER
- if (fDrawingManager) {
- fDrawingManager->cleanup();
+ if (this->drawingManager()) {
+ this->drawingManager()->cleanup();
}
delete fResourceProvider;
delete fResourceCache;
@@ -103,7 +103,6 @@
// Disable the small path renderer bc of the proxies in the atlas. They need to be
// unified when the opLists are added back to the destination drawing manager.
prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kSmall;
- prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kStencilAndCover;
}
GrTextContext::Options textContextOptions;
@@ -158,7 +157,7 @@
// Need to cleanup the drawing manager first so all the render targets
// will be released/forgotten before they too are abandoned.
- fDrawingManager->cleanup();
+ this->drawingManager()->cleanup();
// abandon first to so destructors
// don't try to free the resources in the API.
@@ -168,7 +167,6 @@
fGlyphCache->freeAll();
fTextBlobCache->freeAll();
-
}
void GrContext::releaseResourcesAndAbandonContext() {
@@ -182,7 +180,7 @@
// Need to cleanup the drawing manager first so all the render targets
// will be released/forgotten before they too are abandoned.
- fDrawingManager->cleanup();
+ this->drawingManager()->cleanup();
// Release all resources in the backend 3D API.
fResourceCache->releaseAll();
@@ -210,7 +208,7 @@
fGlyphCache->freeAll();
- fDrawingManager->freeGpuResources();
+ this->drawingManager()->freeGpuResources();
fResourceCache->purgeAllUnlocked();
}
@@ -230,7 +228,7 @@
fResourceCache->purgeAsNeeded();
fResourceCache->purgeResourcesNotUsedSince(purgeTime);
- if (auto ccpr = fDrawingManager->getCoverageCountingPathRenderer()) {
+ if (auto ccpr = this->drawingManager()->getCoverageCountingPathRenderer()) {
ccpr->purgeCacheEntriesOlderThan(this->proxyProvider(), purgeTime);
}
@@ -292,7 +290,7 @@
ASSERT_SINGLE_OWNER
RETURN_IF_ABANDONED
- fDrawingManager->flush(nullptr);
+ this->drawingManager()->flush(nullptr);
}
GrSemaphoresSubmitted GrContext::flushAndSignalSemaphores(int numSemaphores,
@@ -302,7 +300,7 @@
return GrSemaphoresSubmitted::kNo;
}
- return fDrawingManager->flush(nullptr, numSemaphores, signalSemaphores);
+ return this->drawingManager()->flush(nullptr, numSemaphores, signalSemaphores);
}
////////////////////////////////////////////////////////////////////////////////