aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/gpu/GrTextureProducer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gpu/GrTextureProducer.cpp b/src/gpu/GrTextureProducer.cpp
index 8499b8abe5..8d3549d5d1 100644
--- a/src/gpu/GrTextureProducer.cpp
+++ b/src/gpu/GrTextureProducer.cpp
@@ -236,6 +236,11 @@ sk_sp<GrTextureProxy> GrTextureProducer::refTextureProxyForParams(
this->onRefTextureProxyForParams(sampler, dstColorSpace, proxyColorSpace, willBeMipped,
scaleAdjust);
+ // Check to make sure that if we say the texture willBeMipped that the returned texture has mip
+ // maps, unless the config is not copyable.
+ SkASSERT(!result || !willBeMipped || result->mipMapped() == GrMipMapped::kYes ||
+ !fContext->contextPriv().caps()->isConfigCopyable(result->config()));
+
// Check that the "no scaling expected" case always returns a proxy of the same size as the
// producer.
SkASSERT(!result || !expectNoScale ||
@@ -259,6 +264,11 @@ sk_sp<GrTextureProxy> GrTextureProducer::refTextureProxy(GrMipMapped willNeedMip
this->onRefTextureProxyForParams(sampler, dstColorSpace, proxyColorSpace,
willBeMipped, nullptr);
+ // Check to make sure that if we say the texture willBeMipped that the returned texture has mip
+ // maps, unless the config is not copyable.
+ SkASSERT(!result || !willBeMipped || result->mipMapped() == GrMipMapped::kYes ||
+ !fContext->contextPriv().caps()->isConfigCopyable(result->config()));
+
// Check that no scaling occured and we returned a proxy of the same size as the producer.
SkASSERT(!result || (result->width() == this->width() && result->height() == this->height()));
return result;