aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrTextureProducer.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-07-19 21:33:11 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-19 21:33:16 +0000
commitc861eee3a6f1f93ad3df27b8be94f44b245bd128 (patch)
tree1c4f0307a456002c784d6428e77c45b9032b7576 /src/gpu/GrTextureProducer.cpp
parent6a3957c1f9cbeca9107708462150fb766993ac0a (diff)
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 <brianosman@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> 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 <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrTextureProducer.cpp')
-rw-r--r--src/gpu/GrTextureProducer.cpp25
1 files changed, 2 insertions, 23 deletions
diff --git a/src/gpu/GrTextureProducer.cpp b/src/gpu/GrTextureProducer.cpp
index cdf2a476e3..59962c55b1 100644
--- a/src/gpu/GrTextureProducer.cpp
+++ b/src/gpu/GrTextureProducer.cpp
@@ -11,7 +11,6 @@
#include "GrRenderTargetContext.h"
#include "GrTextureProxy.h"
#include "SkGr.h"
-#include "SkMipMap.h"
#include "SkRectPriv.h"
#include "effects/GrBicubicEffect.h"
#include "effects/GrSimpleTextureEffect.h"
@@ -227,18 +226,8 @@ sk_sp<GrTextureProxy> GrTextureProducer::refTextureProxyForParams(
SkDEBUGCODE(bool expectNoScale = (sampler.filter() != GrSamplerState::Filter::kMipMap &&
!sampler.isRepeated()));
SkASSERT(scaleAdjust || expectNoScale);
-
- int mipCount = SkMipMap::ComputeLevelCount(this->width(), this->height());
- bool willBeMipped = GrSamplerState::Filter::kMipMap == sampler.filter() && mipCount &&
- fContext->contextPriv().caps()->mipMapSupport();
-
auto result =
- 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.
- SkASSERT(!result || !willBeMipped || result->mipMapped() == GrMipMapped::kYes);
+ this->onRefTextureProxyForParams(sampler, dstColorSpace, proxyColorSpace, scaleAdjust);
// Check that the "no scaling expected" case always returns a proxy of the same size as the
// producer.
@@ -254,18 +243,8 @@ sk_sp<GrTextureProxy> GrTextureProducer::refTextureProxy(GrMipMapped willNeedMip
GrMipMapped::kNo == willNeedMips ? GrSamplerState::Filter::kNearest
: GrSamplerState::Filter::kMipMap;
GrSamplerState sampler(GrSamplerState::WrapMode::kClamp, filter);
-
- int mipCount = SkMipMap::ComputeLevelCount(this->width(), this->height());
- bool willBeMipped = GrSamplerState::Filter::kMipMap == sampler.filter() && mipCount &&
- fContext->contextPriv().caps()->mipMapSupport();
-
auto result =
- 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.
- SkASSERT(!result || !willBeMipped || result->mipMapped() == GrMipMapped::kYes);
+ this->onRefTextureProxyForParams(sampler, dstColorSpace, proxyColorSpace, nullptr);
// 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()));