From c861eee3a6f1f93ad3df27b8be94f44b245bd128 Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Thu, 19 Jul 2018 21:33:11 +0000 Subject: Revert "Don't require mips in GrTextureProducer if texture is 1x1." This reverts commit 5191fd7555d34225ef771ad4cac65bcbbb50a89c. Reason for revert: breaking angle Original change's description: > Don't require mips in GrTextureProducer if texture is 1x1. > > Bug: chromium:862921 > Change-Id: I5f3584ad36e160a5a09d0a37e31e147155076b4d > Reviewed-on: https://skia-review.googlesource.com/142586 > Reviewed-by: Brian Osman > Reviewed-by: Brian Salomon > Commit-Queue: Greg Daniel TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com Change-Id: Iaef7a56b061cb41f4c75ec20d8df77d3e52b194d No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:862921 Reviewed-on: https://skia-review.googlesource.com/142600 Reviewed-by: Greg Daniel Commit-Queue: Greg Daniel --- src/gpu/GrTextureAdjuster.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gpu/GrTextureAdjuster.cpp') diff --git a/src/gpu/GrTextureAdjuster.cpp b/src/gpu/GrTextureAdjuster.cpp index b2fc0584ba..d016896c3f 100644 --- a/src/gpu/GrTextureAdjuster.cpp +++ b/src/gpu/GrTextureAdjuster.cpp @@ -17,8 +17,9 @@ GrTextureAdjuster::GrTextureAdjuster(GrContext* context, sk_sp o SkAlphaType alphaType, uint32_t uniqueID, SkColorSpace* cs) - : INHERITED(context, original->width(), original->height(), + : INHERITED(original->width(), original->height(), GrPixelConfigIsAlphaOnly(original->config())) + , fContext(context) , fOriginal(std::move(original)) , fAlphaType(alphaType) , fColorSpace(cs) @@ -76,7 +77,6 @@ sk_sp GrTextureAdjuster::onRefTextureProxyForParams( const GrSamplerState& params, SkColorSpace* dstColorSpace, sk_sp* texColorSpace, - bool willBeMipped, SkScalar scaleAdjust[2]) { sk_sp proxy = this->originalProxyRef(); CopyParams copyParams; @@ -105,6 +105,8 @@ sk_sp GrTextureAdjuster::onRefTextureProxyForParams( } } + bool willBeMipped = GrSamplerState::Filter::kMipMap == params.filter() && + fContext->contextPriv().caps()->mipMapSupport(); sk_sp result = this->refTextureProxyCopy(copyParams, willBeMipped); if (!result && needsCopyForMipsOnly) { // If we were unable to make a copy and we only needed a copy for mips, then we will return -- cgit v1.2.3