diff options
Diffstat (limited to 'src/gpu/GrTextureAdjuster.cpp')
-rw-r--r-- | src/gpu/GrTextureAdjuster.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/gpu/GrTextureAdjuster.cpp b/src/gpu/GrTextureAdjuster.cpp index cb296f9ce9..cc61533044 100644 --- a/src/gpu/GrTextureAdjuster.cpp +++ b/src/gpu/GrTextureAdjuster.cpp @@ -43,11 +43,10 @@ sk_sp<GrTextureProxy> GrTextureAdjuster::refTextureProxyCopy(const CopyParams& c GrUniqueKey key; this->makeCopyKey(copyParams, &key, nullptr); - sk_sp<GrTextureProxy> cachedCopy; if (key.isValid()) { - cachedCopy = proxyProvider->findOrCreateProxyByUniqueKey(key, - this->originalProxy()->origin()); - if (cachedCopy && (!willBeMipped || GrMipMapped::kYes == cachedCopy->mipMapped())) { + sk_sp<GrTextureProxy> cachedCopy = + proxyProvider->findOrCreateProxyByUniqueKey(key, this->originalProxy()->origin()); + if (cachedCopy) { return cachedCopy; } } @@ -58,14 +57,6 @@ sk_sp<GrTextureProxy> GrTextureAdjuster::refTextureProxyCopy(const CopyParams& c if (copy) { if (key.isValid()) { SkASSERT(copy->origin() == this->originalProxy()->origin()); - if (cachedCopy) { - SkASSERT(GrMipMapped::kYes == copy->mipMapped() && - GrMipMapped::kNo == cachedCopy->mipMapped()); - // If we had a cachedProxy, 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, cachedCopy.get()); - } proxyProvider->assignUniqueKeyToProxy(key, copy.get()); this->didCacheCopy(key); } @@ -98,8 +89,7 @@ sk_sp<GrTextureProxy> GrTextureAdjuster::onRefTextureProxyForParams( return proxy; } - bool willBeMipped = GrSamplerState::Filter::kMipMap == params.filter() && - fContext->contextPriv().caps()->mipMapSupport(); + bool willBeMipped = GrSamplerState::Filter::kMipMap == params.filter(); return this->refTextureProxyCopy(copyParams, willBeMipped); } |