aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkImage_Lazy.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-02-15 13:06:26 -0500
committerGravatar Greg Daniel <egdaniel@google.com>2018-02-15 20:13:32 +0000
commitf6f7b67ac230b14a725fbdabe951c70ea5b4428f (patch)
treea75cefe0e22e69aeaa9a862714818d4684afddc3 /src/image/SkImage_Lazy.cpp
parent602836138e02935885c77f9dd93dcb51a3ec9a64 (diff)
When creating emptyp MipMap proxies, don't instantiate them immediately. Attempt 3
original: https://skia-review.googlesource.com/106966 Bug: skia: Change-Id: I779985cef2d3c4f36a0129d8ecedd12e510bec7e Reviewed-on: https://skia-review.googlesource.com/107781 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.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/image/SkImage_Lazy.cpp b/src/image/SkImage_Lazy.cpp
index 1fc6d95094..4adf4e8368 100644
--- a/src/image/SkImage_Lazy.cpp
+++ b/src/image/SkImage_Lazy.cpp
@@ -701,12 +701,13 @@ static void set_key_on_proxy(GrProxyProvider* proxyProvider,
const GrUniqueKey& key) {
if (key.isValid()) {
SkASSERT(proxy->origin() == kTopLeft_GrSurfaceOrigin);
- if (originalProxy) {
+ if (originalProxy && originalProxy->getUniqueKey().isValid()) {
+ SkASSERT(originalProxy->getUniqueKey() == key);
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.
+ // If we had an originalProxy with a valid key, 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.
proxyProvider->removeUniqueKeyFromProxy(key, originalProxy);
}
proxyProvider->assignUniqueKeyToProxy(key, proxy);