aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkImage_Lazy.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-10-23 16:05:23 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-23 20:25:59 +0000
commite252f08982b0c747cd4d34c00ce413ab1005e99a (patch)
tree1fde0a4ac30cf4dc1fc752ef39fc2a0b905be210 /src/image/SkImage_Lazy.cpp
parent33397f279393a33eff8e32d47fc56be86b86c9bc (diff)
Add hint to SkSurface::MakeRenderTarget that we will use mips
Additionally this changed triggered a cascade of plumbing GrMipMapped down throughout Ganesh. Bug: skia: Change-Id: I4181f44d9046d66139bb491c7abf86703305aaeb Reviewed-on: https://skia-review.googlesource.com/63000 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/image/SkImage_Lazy.cpp')
-rw-r--r--src/image/SkImage_Lazy.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/image/SkImage_Lazy.cpp b/src/image/SkImage_Lazy.cpp
index 8e055f395e..b18b17a870 100644
--- a/src/image/SkImage_Lazy.cpp
+++ b/src/image/SkImage_Lazy.cpp
@@ -701,7 +701,8 @@ static void set_key_on_proxy(GrResourceProvider* resourceProvider,
if (key.isValid()) {
SkASSERT(proxy->origin() == kTopLeft_GrSurfaceOrigin);
if (originalProxy) {
- SkASSERT(proxy->isMipMapped() && !originalProxy->isMipMapped());
+ SkASSERT(GrMipMapped::kYes == proxy->mipMapped() &&
+ GrMipMapped::kNo == originalProxy->mipMapped());
// If we had an originalProxy, that means there already is a proxy in the cache which
// matches the key, but it does not have mip levels and we require them. Thus we must
// remove the unique key from that proxy.
@@ -768,7 +769,7 @@ sk_sp<GrTextureProxy> SkImage_Lazy::lockTextureProxy(GrContext* ctx,
if (proxy) {
SK_HISTOGRAM_ENUMERATION("LockTexturePath", kPreExisting_LockTexturePath,
kLockTexturePathCount);
- if (!willBeMipped || proxy->isMipMapped()) {
+ if (!willBeMipped || GrMipMapped::kYes == proxy->mipMapped()) {
return proxy;
}
}
@@ -793,7 +794,7 @@ sk_sp<GrTextureProxy> SkImage_Lazy::lockTextureProxy(GrContext* ctx,
SK_HISTOGRAM_ENUMERATION("LockTexturePath", kNative_LockTexturePath,
kLockTexturePathCount);
set_key_on_proxy(ctx->resourceProvider(), proxy.get(), nullptr, key);
- if (!willBeMipped || proxy->isMipMapped()) {
+ if (!willBeMipped || GrMipMapped::kYes == proxy->mipMapped()) {
return proxy;
}
}
@@ -833,7 +834,7 @@ sk_sp<GrTextureProxy> SkImage_Lazy::lockTextureProxy(GrContext* ctx,
if (!proxy) {
proxy = GrUploadBitmapToTextureProxy(ctx->resourceProvider(), bitmap, dstColorSpace);
}
- if (proxy && (!willBeMipped || proxy->isMipMapped())) {
+ if (proxy && (!willBeMipped || GrMipMapped::kYes == proxy->mipMapped())) {
SK_HISTOGRAM_ENUMERATION("LockTexturePath", kRGBA_LockTexturePath,
kLockTexturePathCount);
set_key_on_proxy(ctx->resourceProvider(), proxy.get(), nullptr, key);
@@ -847,7 +848,7 @@ sk_sp<GrTextureProxy> SkImage_Lazy::lockTextureProxy(GrContext* ctx,
// mipped surface and copy the original proxy into the base layer. We will then let the gpu
// generate the rest of the mips.
SkASSERT(willBeMipped);
- SkASSERT(!proxy->isMipMapped());
+ SkASSERT(GrMipMapped::kNo == proxy->mipMapped());
if (auto mippedProxy = GrCopyBaseMipMapToTextureProxy(ctx, proxy.get())) {
set_key_on_proxy(ctx->resourceProvider(), mippedProxy.get(), proxy.get(), key);
return mippedProxy;