diff options
author | Greg Daniel <egdaniel@google.com> | 2017-10-05 16:27:06 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-05 20:51:04 +0000 |
commit | 3e70fa350559c10aaf9f95c65a96d20a2fcfbf2f (patch) | |
tree | d0087922e68660fb195523443d732f7a40220d8c | |
parent | ef8ce2858b7692c9ec9874c43656e603f304c760 (diff) |
When mip mapping, do YUV mip generation on CPU then upload to GPU.
Bug: skia:
Change-Id: I930508b38e828652dfbb7c3f9d934d206cf1d72a
Reviewed-on: https://skia-review.googlesource.com/56060
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
-rw-r--r-- | src/image/SkImage_Lazy.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/image/SkImage_Lazy.cpp b/src/image/SkImage_Lazy.cpp index c67d4df356..26a1ef9f80 100644 --- a/src/image/SkImage_Lazy.cpp +++ b/src/image/SkImage_Lazy.cpp @@ -801,8 +801,9 @@ sk_sp<GrTextureProxy> SkImage_Lazy::lockTextureProxy(GrContext* ctx, } } - // 3. Ask the generator to return YUV planes, which the GPU can convert - if (!proxy && !ctx->contextPriv().disableGpuYUVConversion()) { + // 3. Ask the generator to return YUV planes, which the GPU can convert. If we will be mipping + // the texture we fall through here and have the CPU generate the mip maps for us. + if (!proxy && !willBeMipped && !ctx->contextPriv().disableGpuYUVConversion()) { const GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(cacheInfo, *ctx->caps()); ScopedGenerator generator(fSharedGenerator); Generator_GrYUVProvider provider(generator); @@ -821,9 +822,7 @@ sk_sp<GrTextureProxy> SkImage_Lazy::lockTextureProxy(GrContext* ctx, SK_HISTOGRAM_ENUMERATION("LockTexturePath", kYUV_LockTexturePath, kLockTexturePathCount); set_key_on_proxy(ctx->resourceProvider(), proxy.get(), nullptr, key); - if (!willBeMipped || proxy->isMipMapped()) { - return proxy; - } + return proxy; } } |