From 022b1e08234f1cd16b821aea440d5958e380ee8e Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Fri, 20 Jul 2018 14:54:00 -0400 Subject: Re-add assert for mip maps. Bug: skia: Change-Id: Iec418be2a02b046aa528df4b019be6e98bcdf320 Reviewed-on: https://skia-review.googlesource.com/142802 Reviewed-by: Brian Salomon Commit-Queue: Greg Daniel --- src/gpu/GrTextureProducer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') 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 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 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; -- cgit v1.2.3