Allow implicit conversion from GrSamplerState::Filter to GrSamplerState
constexprify GrSamplerState
pass/return GrSamplerState by value (it's 3 bytes).
Remove unused function from GrTexturePriv
Change-Id: Iffecd941500acf5653f01cc88b42ff1d45678b54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263346
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp
index 6760aa7..e8d549f 100644
--- a/src/gpu/GrFragmentProcessor.cpp
+++ b/src/gpu/GrFragmentProcessor.cpp
@@ -413,9 +413,8 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
GrFragmentProcessor::TextureSampler::TextureSampler(GrSurfaceProxyView view,
- const GrSamplerState& samplerState)
- : fView(std::move(view))
- , fSamplerState(samplerState) {
+ GrSamplerState samplerState)
+ : fView(std::move(view)), fSamplerState(samplerState) {
GrSurfaceProxy* proxy = this->proxy();
fSamplerState.setFilterMode(
SkTMin(samplerState.filter(),
@@ -423,7 +422,7 @@
}
GrFragmentProcessor::TextureSampler::TextureSampler(sk_sp<GrSurfaceProxy> proxy,
- const GrSamplerState& samplerState) {
+ GrSamplerState samplerState) {
SkASSERT(proxy->asTextureProxy());
GrSurfaceOrigin origin = proxy->origin();
GrSwizzle swizzle = proxy->textureSwizzle();
@@ -438,7 +437,7 @@
#if GR_TEST_UTILS
void GrFragmentProcessor::TextureSampler::set(GrSurfaceProxyView view,
- const GrSamplerState& samplerState) {
+ GrSamplerState samplerState) {
SkASSERT(view.proxy()->asTextureProxy());
fView = std::move(view);
fSamplerState = samplerState;