Fix check for valid proxies returned by AtlasManager.
Also renames a lot of variables to make it clearer that getProxies()
returns the number of instantiated proxies, not the number of all
proxies.
Bug: skia:
Change-Id: Ifbc910cbd6635dccdb4e7f0df2e69a0f341130af
Reviewed-on: https://skia-review.googlesource.com/128660
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/text/GrAtlasManager.h b/src/gpu/text/GrAtlasManager.h
index 9bf03c1..18ccfd0 100644
--- a/src/gpu/text/GrAtlasManager.h
+++ b/src/gpu/text/GrAtlasManager.h
@@ -30,13 +30,14 @@
// if getProxies returns nullptr, the client must not try to use other functions on the
// GrGlyphCache which use the atlas. This function *must* be called first, before other
- // functions which use the atlas.
- const sk_sp<GrTextureProxy>* getProxies(GrMaskFormat format, unsigned int* numProxies) {
+ // functions which use the atlas. Note that we can have proxies available but none active
+ // (i.e., none instantiated).
+ const sk_sp<GrTextureProxy>* getProxies(GrMaskFormat format, unsigned int* numActiveProxies) {
if (this->initAtlas(format)) {
- *numProxies = this->getAtlas(format)->numActivePages();
+ *numActiveProxies = this->getAtlas(format)->numActivePages();
return this->getAtlas(format)->getProxies();
}
- *numProxies = 0;
+ *numActiveProxies = 0;
return nullptr;
}