diff options
author | Robert Phillips <robertphillips@google.com> | 2018-03-01 11:36:45 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-01 19:09:14 +0000 |
commit | c4039ea466d39ede0ea44fc7a18f1174f893f11d (patch) | |
tree | 76666cf5550f484c879b375135c00e72dd9c4336 /tools/gpu | |
parent | 2d0e1248d6eef36ecc510785e9bf8a28530c56fe (diff) |
Fission GrAtlasGlyphCache in two (take 2)
Reland all the things
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.
TBR=jvanverth@google.com
Change-Id: I05c6cd8d301bf2decca39765e5cae62993d9da04
Reviewed-on: https://skia-review.googlesource.com/111362
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tools/gpu')
-rw-r--r-- | tools/gpu/GrTest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<SkImage> GrContext::getFontAtlasImage_ForTesting(GrMaskFormat format, uint32_t index) { - GrAtlasGlyphCache* cache = this->contextPriv().getAtlasGlyphCache(); +sk_sp<SkImage> GrContext::getFontAtlasImage_ForTesting(GrMaskFormat format, unsigned int index) { + auto restrictedAtlasManager = this->contextPriv().getRestrictedAtlasManager(); unsigned int numProxies; - const sk_sp<GrTextureProxy>* proxies = cache->getProxies(format, &numProxies); + const sk_sp<GrTextureProxy>* proxies = restrictedAtlasManager->getProxies(format, &numProxies); if (index >= numProxies || !proxies[index]) { return nullptr; } |