Lift TextureSampler's proxy to SurfaceProxy
Now that the UniformHandlers can accept SurfaceProxies directly, there's
no need to have the restricted type on TextureSampler anymore. This will
make them one step closer to compatibility with GrSurfaceProxyView.
While making these changes, several effects performed their own source
coord normalization by peeking the texture. I updated these to just
use the proxy's backing store dimensions.
Bug: skia:9556
Change-Id: I97183e8453b7a3db86cd90d614c8c959b3707abb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255978
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrTextureProxy.cpp b/src/gpu/GrTextureProxy.cpp
index eb5b8bb..26d95ab 100644
--- a/src/gpu/GrTextureProxy.cpp
+++ b/src/gpu/GrTextureProxy.cpp
@@ -130,11 +130,6 @@
fTextureProxy->fDeferredUploader.reset();
}
-GrSamplerState::Filter GrTextureProxy::highestFilterMode() const {
- return this->hasRestrictedSampling() ? GrSamplerState::Filter::kBilerp
- : GrSamplerState::Filter::kMipMap;
-}
-
GrMipMapped GrTextureProxy::mipMapped() const {
if (this->isInstantiated()) {
return this->peekTexture()->texturePriv().mipMapped();
@@ -147,6 +142,11 @@
this->proxyMipMapped(), !this->priv().isExact());
}
+GrSamplerState::Filter GrTextureProxy::HighestFilterMode(GrTextureType textureType) {
+ return GrTextureTypeHasRestrictedSampling(textureType) ? GrSamplerState::Filter::kBilerp
+ : GrSamplerState::Filter::kMipMap;
+}
+
bool GrTextureProxy::ProxiesAreCompatibleAsDynamicState(const GrSurfaceProxy* first,
const GrSurfaceProxy* second) {
// In order to be compatible, the proxies should also have the same texture type, but since