Revert "Update FragmentProcessor TextureSampler to hold an GrSurfaceProxyView."
This reverts commit acf5929ae0addc5188117142fd3fb39828baa8d5.
Reason for revert: May be blocking Chrome roll
Original change's description:
> Update FragmentProcessor TextureSampler to hold an GrSurfaceProxyView.
>
> In future CLs I will update the Ops that create the TextureSamplers to pass
> the GrSurfaceProxyView in.
>
> Bug: skia:9556
> Change-Id: I550dab64974d32e4c3047188063efa2d0832328e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259164
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
TBR=egdaniel@google.com,michaelludwig@google.com
Change-Id: Ic804a52c5c6d16a13a9cc2d85bb959f305134177
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9556
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259433
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp
index 6760aa7..b836be4 100644
--- a/src/gpu/GrFragmentProcessor.cpp
+++ b/src/gpu/GrFragmentProcessor.cpp
@@ -50,7 +50,7 @@
void GrFragmentProcessor::visitProxies(const GrOp::VisitProxyFunc& func) {
for (auto [sampler, fp] : FPTextureSamplerRange(*this)) {
bool mipped = (GrSamplerState::Filter::kMipMap == sampler.samplerState().filter());
- func(sampler.view().proxy(), GrMipMapped(mipped));
+ func(sampler.proxy(), GrMipMapped(mipped));
}
}
@@ -412,39 +412,17 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-GrFragmentProcessor::TextureSampler::TextureSampler(GrSurfaceProxyView view,
- const GrSamplerState& samplerState)
- : fView(std::move(view))
- , fSamplerState(samplerState) {
- GrSurfaceProxy* proxy = this->proxy();
- fSamplerState.setFilterMode(
- SkTMin(samplerState.filter(),
- GrTextureProxy::HighestFilterMode(proxy->backendFormat().textureType())));
-}
-
GrFragmentProcessor::TextureSampler::TextureSampler(sk_sp<GrSurfaceProxy> proxy,
const GrSamplerState& samplerState) {
+ this->reset(std::move(proxy), samplerState);
+}
+
+void GrFragmentProcessor::TextureSampler::reset(sk_sp<GrSurfaceProxy> proxy,
+ const GrSamplerState& samplerState) {
SkASSERT(proxy->asTextureProxy());
- GrSurfaceOrigin origin = proxy->origin();
- GrSwizzle swizzle = proxy->textureSwizzle();
- fView = GrSurfaceProxyView(std::move(proxy), origin, swizzle);
-
+ fProxy = std::move(proxy);
fSamplerState = samplerState;
- GrSurfaceProxy* surfProxy = this->proxy();
fSamplerState.setFilterMode(
SkTMin(samplerState.filter(),
- GrTextureProxy::HighestFilterMode(surfProxy->backendFormat().textureType())));
+ GrTextureProxy::HighestFilterMode(fProxy->backendFormat().textureType())));
}
-
-#if GR_TEST_UTILS
-void GrFragmentProcessor::TextureSampler::set(GrSurfaceProxyView view,
- const GrSamplerState& samplerState) {
- SkASSERT(view.proxy()->asTextureProxy());
- fView = std::move(view);
- fSamplerState = samplerState;
-
- fSamplerState.setFilterMode(
- SkTMin(samplerState.filter(),
- GrTextureProxy::HighestFilterMode(this->proxy()->backendFormat().textureType())));
-}
-#endif