From 2bbdcc44c63974f29f3743bb58d929601a3f65c6 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Thu, 7 Sep 2017 12:36:34 -0400 Subject: Rework GrSamplerParams to be more compact and use its own wrap mode enum. The main change is to make GrSamplerParams smaller by making its enums have byte-sized underlying types. The rest is cosmetic. Change-Id: Ib71ea50612d24619a85e463826c6b8dfb9b445e3 Reviewed-on: https://skia-review.googlesource.com/43200 Commit-Queue: Brian Salomon Reviewed-by: Greg Daniel --- src/gpu/GrProcessor.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/gpu/GrProcessor.cpp') diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp index 148c01178b..7ea597221b 100644 --- a/src/gpu/GrProcessor.cpp +++ b/src/gpu/GrProcessor.cpp @@ -9,7 +9,7 @@ #include "GrContext.h" #include "GrGeometryProcessor.h" #include "GrMemoryPool.h" -#include "GrSamplerParams.h" +#include "GrSamplerState.h" #include "GrTextureProxy.h" #include "GrXferProcessor.h" #include "SkSpinlock.h" @@ -220,33 +220,33 @@ bool GrResourceIOProcessor::hasSameSamplersAndAccesses(const GrResourceIOProcess GrResourceIOProcessor::TextureSampler::TextureSampler() {} GrResourceIOProcessor::TextureSampler::TextureSampler(sk_sp proxy, - const GrSamplerParams& params) { - this->reset(std::move(proxy), params); + const GrSamplerState& samplerState) { + this->reset(std::move(proxy), samplerState); } GrResourceIOProcessor::TextureSampler::TextureSampler(sk_sp proxy, - GrSamplerParams::FilterMode filterMode, - SkShader::TileMode tileXAndY, + GrSamplerState::Filter filterMode, + GrSamplerState::WrapMode wrapXAndY, GrShaderFlags visibility) { - this->reset(std::move(proxy), filterMode, tileXAndY, visibility); + this->reset(std::move(proxy), filterMode, wrapXAndY, visibility); } void GrResourceIOProcessor::TextureSampler::reset(sk_sp proxy, - const GrSamplerParams& params, + const GrSamplerState& samplerState, GrShaderFlags visibility) { - fParams = params; + fSamplerState = samplerState; fProxyRef.setProxy(std::move(proxy), kRead_GrIOType); - fParams.setFilterMode(SkTMin(params.filterMode(), this->proxy()->highestFilterMode())); + fSamplerState.setFilterMode(SkTMin(samplerState.filter(), this->proxy()->highestFilterMode())); fVisibility = visibility; } void GrResourceIOProcessor::TextureSampler::reset(sk_sp proxy, - GrSamplerParams::FilterMode filterMode, - SkShader::TileMode tileXAndY, + GrSamplerState::Filter filterMode, + GrSamplerState::WrapMode wrapXAndY, GrShaderFlags visibility) { fProxyRef.setProxy(std::move(proxy), kRead_GrIOType); filterMode = SkTMin(filterMode, this->proxy()->highestFilterMode()); - fParams.reset(tileXAndY, filterMode); + fSamplerState = GrSamplerState(wrapXAndY, filterMode); fVisibility = visibility; } -- cgit v1.2.3