Revert "Fission GrAtlasGlyphCache in two"
This reverts commit acf17904d6286f2a63a5d895541804d0ea1be646.
Reason for revert: Chrome
Original change's description:
> Fission GrAtlasGlyphCache in two
>
> This CL splits the old GrAtlasGlyphCache into a GrAtlasGlyphCache and an GrAtlasManager.
>
> The GrAtlasManager itself is split into a rather limited base class (GrRestrictedAtlasManager)
> and the all powerful GrAtlasManager. The GrRestrictedAtlasManager is available at op creation
> time and provides access to the proxies backing the atlases. The full GrAtlasManager is
> only available at flush time and allows instantiation of the proxies and uploading to them.
>
> In the DDL world all of the DDL Contexts will receive a GrRestrictedAtlasManager-version of the
> GrAtlasManager in the main thread. This future atlas manager will have had all of its
> GrDrawOpAtlases created (but not instantiated) so there should be no race conditions.
>
> Change-Id: I9967d3a4116af50128f390c5039a712b8cd4db08
> Reviewed-on: https://skia-review.googlesource.com/108001
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
TBR=jvanverth@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: I7c760ea1a9f041a310b96d552aa1497ee5902cd8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/111040
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 6fbc4fe0..38e170b 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -77,7 +77,6 @@
GrDDLContext(GrContextThreadSafeProxy* proxy) : INHERITED(proxy) {}
protected:
- // DDL TODO: grab a GrRestrictedAtlasManager from the proxy
private:
typedef GrContext INHERITED;
@@ -219,8 +218,7 @@
fResourceCache = nullptr;
fResourceProvider = nullptr;
fProxyProvider = nullptr;
- fGlyphCache = nullptr;
- fFullAtlasManager = nullptr;
+ fAtlasGlyphCache = nullptr;
}
GrContext::GrContext(GrContextThreadSafeProxy* proxy)
@@ -230,8 +228,7 @@
fResourceCache = nullptr;
fResourceProvider = nullptr;
fProxyProvider = nullptr;
- fGlyphCache = nullptr;
- fFullAtlasManager = nullptr;
+ fAtlasGlyphCache = nullptr;
}
bool GrContext::init(const GrContextOptions& options) {
@@ -296,17 +293,9 @@
} else {
allowMultitexturing = GrDrawOpAtlas::AllowMultitexturing::kYes;
}
-
- fGlyphCache = new GrGlyphCache;
-
- // DDL TODO: in DDL-mode grab a GrRestrictedAtlasManager from the thread-proxy and
- // do not add an onFlushCB
- fFullAtlasManager = new GrAtlasManager(fProxyProvider, fGlyphCache,
- options.fGlyphCacheTextureMaximumBytes,
- allowMultitexturing);
- this->contextPriv().addOnFlushCallbackObject(fFullAtlasManager);
-
- fGlyphCache->setGlyphSizeLimit(fFullAtlasManager->getGlyphSizeLimit());
+ fAtlasGlyphCache = new GrAtlasGlyphCache(fProxyProvider, options.fGlyphCacheTextureMaximumBytes,
+ allowMultitexturing);
+ this->contextPriv().addOnFlushCallbackObject(fAtlasGlyphCache);
fTextBlobCache.reset(new GrTextBlobCache(TextBlobCacheOverBudgetCB,
this, this->uniqueID(), SkToBool(fGpu)));
@@ -338,8 +327,7 @@
delete fResourceProvider;
delete fResourceCache;
delete fProxyProvider;
- delete fGlyphCache;
- delete fFullAtlasManager;
+ delete fAtlasGlyphCache;
}
sk_sp<GrContextThreadSafeProxy> GrContext::threadSafeProxy() {
@@ -398,8 +386,7 @@
fGpu->disconnect(GrGpu::DisconnectType::kAbandon);
- fGlyphCache->freeAll();
- fFullAtlasManager->freeAll();
+ fAtlasGlyphCache->freeAll();
fTextBlobCache->freeAll();
}
@@ -418,8 +405,7 @@
fGpu->disconnect(GrGpu::DisconnectType::kCleanup);
- fGlyphCache->freeAll();
- fFullAtlasManager->freeAll();
+ fAtlasGlyphCache->freeAll();
fTextBlobCache->freeAll();
}
@@ -433,8 +419,7 @@
this->flush();
- fGlyphCache->freeAll();
- fFullAtlasManager->freeAll();
+ fAtlasGlyphCache->freeAll();
fDrawingManager->freeGpuResources();