diff options
Diffstat (limited to 'src/gpu/GrTextureProducer.cpp')
-rw-r--r-- | src/gpu/GrTextureProducer.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gpu/GrTextureProducer.cpp b/src/gpu/GrTextureProducer.cpp index 1e9c3acd16..59962c55b1 100644 --- a/src/gpu/GrTextureProducer.cpp +++ b/src/gpu/GrTextureProducer.cpp @@ -235,3 +235,18 @@ sk_sp<GrTextureProxy> GrTextureProducer::refTextureProxyForParams( (result->width() == this->width() && result->height() == this->height())); return result; } + +sk_sp<GrTextureProxy> GrTextureProducer::refTextureProxy(GrMipMapped willNeedMips, + SkColorSpace* dstColorSpace, + sk_sp<SkColorSpace>* proxyColorSpace) { + GrSamplerState::Filter filter = + GrMipMapped::kNo == willNeedMips ? GrSamplerState::Filter::kNearest + : GrSamplerState::Filter::kMipMap; + GrSamplerState sampler(GrSamplerState::WrapMode::kClamp, filter); + auto result = + 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())); + return result; +} |