diff options
Diffstat (limited to 'tools/gpu/GrTest.cpp')
-rw-r--r-- | tools/gpu/GrTest.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/gpu/GrTest.cpp b/tools/gpu/GrTest.cpp index 25c5a602f9..e76731b59f 100644 --- a/tools/gpu/GrTest.cpp +++ b/tools/gpu/GrTest.cpp @@ -147,17 +147,17 @@ void GrContext::printGpuStats() const { SkDebugf("%s", out.c_str()); } -sk_sp<SkImage> GrContext::getFontAtlasImage_ForTesting(GrMaskFormat format) { +sk_sp<SkImage> GrContext::getFontAtlasImage_ForTesting(GrMaskFormat format, uint32_t index) { GrAtlasGlyphCache* cache = this->contextPriv().getAtlasGlyphCache(); const sk_sp<GrTextureProxy>* proxies = cache->getProxies(format); - if (!proxies[0]) { + if (index >= cache->getAtlasPageCount(format) || !proxies[index]) { return nullptr; } - SkASSERT(proxies[0]->priv().isExact()); + SkASSERT(proxies[index]->priv().isExact()); sk_sp<SkImage> image(new SkImage_Gpu(this, kNeedNewImageUniqueID, kPremul_SkAlphaType, - std::move(proxies[0]), nullptr, SkBudgeted::kNo)); + std::move(proxies[index]), nullptr, SkBudgeted::kNo)); return image; } |