aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-07-20 14:54:00 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-20 20:28:16 +0000
commit022b1e08234f1cd16b821aea440d5958e380ee8e (patch)
treea9bdca3d1d8a9962f8917dc2e4af19440ed2df18 /src
parentd3509a42638a06b328917723fcaad1d4393431b2 (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.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;