diff options
author | Greg Daniel <egdaniel@google.com> | 2018-07-20 14:54:00 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-20 20:28:16 +0000 |
commit | 022b1e08234f1cd16b821aea440d5958e380ee8e (patch) | |
tree | a9bdca3d1d8a9962f8917dc2e4af19440ed2df18 /src | |
parent | d3509a42638a06b328917723fcaad1d4393431b2 (diff) |
Re-add assert for mip maps.
Bug: skia:
Change-Id: Iec418be2a02b046aa528df4b019be6e98bcdf320
Reviewed-on: https://skia-review.googlesource.com/142802
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrTextureProducer.cpp | 10 |
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; |