aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/gpu/GrTest.cpp
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2018-01-22 12:45:47 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-22 18:20:27 +0000
commit87d18ced0a54c9ed836a82d4276a4f45b27a2943 (patch)
tree1d401b6e67c6decee1aa1c58123a9e4614a03b2b /tools/gpu/GrTest.cpp
parentde161cb2562c6f96f4e9bb603baa6a21ff8d3a46 (diff)
Add Chinese zoom Sample.
Bug: skia: Change-Id: Ibe5ffee64fe9fccd6b8d86c1310a78d2d51e424e Reviewed-on: https://skia-review.googlesource.com/97065 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'tools/gpu/GrTest.cpp')
-rw-r--r--tools/gpu/GrTest.cpp8
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;
}