diff options
-rw-r--r-- | src/gpu/GrTextureAdjuster.cpp | 3 | ||||
-rw-r--r-- | src/gpu/GrTextureMaker.cpp | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/gpu/GrTextureAdjuster.cpp b/src/gpu/GrTextureAdjuster.cpp index 306ec59220..f30b0eb03d 100644 --- a/src/gpu/GrTextureAdjuster.cpp +++ b/src/gpu/GrTextureAdjuster.cpp @@ -75,6 +75,9 @@ sk_sp<GrTextureProxy> GrTextureAdjuster::refTextureProxySafeForParams(const GrSa return nullptr; } + SkASSERT(this->width() <= fContext->caps()->maxTextureSize() && + this->height() <= fContext->caps()->maxTextureSize()); + if (!GrGpu::IsACopyNeededForTextureParams(fContext->caps(), proxy.get(), proxy->width(), proxy->height(), params, ©Params, scaleAdjust)) { diff --git a/src/gpu/GrTextureMaker.cpp b/src/gpu/GrTextureMaker.cpp index 5db0b481b7..62eb04e7ad 100644 --- a/src/gpu/GrTextureMaker.cpp +++ b/src/gpu/GrTextureMaker.cpp @@ -17,6 +17,11 @@ sk_sp<GrTextureProxy> GrTextureMaker::refTextureProxyForParams(const GrSamplerSt SkColorSpace* dstColorSpace, sk_sp<SkColorSpace>* texColorSpace, SkScalar scaleAdjust[2]) { + if (this->width() > fContext->caps()->maxTextureSize() || + this->height() > fContext->caps()->maxTextureSize()) { + return nullptr; + } + CopyParams copyParams; bool willBeMipped = params.filter() == GrSamplerState::Filter::kMipMap; |