From acf17904d6286f2a63a5d895541804d0ea1be646 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Tue, 27 Feb 2018 16:43:18 -0500 Subject: 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 Reviewed-by: Jim Van Verth --- tools/gpu/GrTest.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tools/gpu/GrTest.cpp') diff --git a/tools/gpu/GrTest.cpp b/tools/gpu/GrTest.cpp index c6d3bbe2ef..c483a22aac 100644 --- a/tools/gpu/GrTest.cpp +++ b/tools/gpu/GrTest.cpp @@ -26,7 +26,7 @@ #include "SkMathPriv.h" #include "SkString.h" #include "ops/GrMeshDrawOp.h" -#include "text/GrAtlasGlyphCache.h" +#include "text/GrGlyphCache.h" #include "text/GrTextBlobCache.h" namespace GrTest { @@ -94,7 +94,7 @@ void GrContext::setTextBlobCacheLimit_ForTesting(size_t bytes) { } void GrContext::setTextContextAtlasSizes_ForTesting(const GrDrawOpAtlasConfig* configs) { - fAtlasGlyphCache->setAtlasSizes_ForTesting(configs); + fFullAtlasManager->setAtlasSizes_ForTesting(configs); } /////////////////////////////////////////////////////////////////////////////// @@ -147,11 +147,11 @@ void GrContext::printGpuStats() const { SkDebugf("%s", out.c_str()); } -sk_sp GrContext::getFontAtlasImage_ForTesting(GrMaskFormat format, uint32_t index) { - GrAtlasGlyphCache* cache = this->contextPriv().getAtlasGlyphCache(); +sk_sp GrContext::getFontAtlasImage_ForTesting(GrMaskFormat format, unsigned int index) { + auto restrictedAtlasManager = this->contextPriv().getRestrictedAtlasManager(); unsigned int numProxies; - const sk_sp* proxies = cache->getProxies(format, &numProxies); + const sk_sp* proxies = restrictedAtlasManager->getProxies(format, &numProxies); if (index >= numProxies || !proxies[index]) { return nullptr; } -- cgit v1.2.3