diff options
author | Brian Salomon <bsalomon@google.com> | 2017-09-07 12:36:34 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-07 16:58:31 +0000 |
commit | 2bbdcc44c63974f29f3743bb58d929601a3f65c6 (patch) | |
tree | d420f298f606b061054e56866d1930ab84f00ed5 /src/gpu/effects/GrTextureDomain.cpp | |
parent | 4df0092eac6e9bb5afc516773a0c618630193dc6 (diff) |
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 <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/effects/GrTextureDomain.cpp')
-rw-r--r-- | src/gpu/effects/GrTextureDomain.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp index 5101762bd9..3bb96b23cd 100644 --- a/src/gpu/effects/GrTextureDomain.cpp +++ b/src/gpu/effects/GrTextureDomain.cpp @@ -212,7 +212,7 @@ std::unique_ptr<GrFragmentProcessor> GrTextureDomainEffect::Make( const SkMatrix& matrix, const SkRect& domain, GrTextureDomain::Mode mode, - GrSamplerParams::FilterMode filterMode) { + GrSamplerState::Filter filterMode) { if (GrTextureDomain::kIgnore_Mode == mode || (GrTextureDomain::kClamp_Mode == mode && can_ignore_rect(proxy.get(), domain))) { return GrSimpleTextureEffect::Make(std::move(proxy), @@ -228,14 +228,14 @@ GrTextureDomainEffect::GrTextureDomainEffect(sk_sp<GrTextureProxy> proxy, const SkMatrix& matrix, const SkRect& domain, GrTextureDomain::Mode mode, - GrSamplerParams::FilterMode filterMode) + GrSamplerState::Filter filterMode) : INHERITED(OptFlags(proxy->config(), mode)) , fCoordTransform(matrix, proxy.get()) , fTextureDomain(proxy.get(), domain, mode) , fTextureSampler(std::move(proxy), filterMode) , fColorSpaceXform(std::move(colorSpaceXform)) { SkASSERT(mode != GrTextureDomain::kRepeat_Mode || - filterMode == GrSamplerParams::kNone_FilterMode); + filterMode == GrSamplerState::Filter::kNearest); this->initClassID<GrTextureDomainEffect>(); this->addCoordTransform(&fCoordTransform); this->addTextureSampler(&fTextureSampler); @@ -325,13 +325,13 @@ std::unique_ptr<GrFragmentProcessor> GrTextureDomainEffect::TestCreate(GrProcess const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom); bool bilerp = mode != GrTextureDomain::kRepeat_Mode ? d->fRandom->nextBool() : false; sk_sp<GrColorSpaceXform> colorSpaceXform = GrTest::TestColorXform(d->fRandom); - return GrTextureDomainEffect::Make(std::move(proxy), - std::move(colorSpaceXform), - matrix, - domain, - mode, - bilerp ? GrSamplerParams::kBilerp_FilterMode - : GrSamplerParams::kNone_FilterMode); + return GrTextureDomainEffect::Make( + std::move(proxy), + std::move(colorSpaceXform), + matrix, + domain, + mode, + bilerp ? GrSamplerState::Filter::kBilerp : GrSamplerState::Filter::kNearest); } #endif @@ -343,11 +343,9 @@ std::unique_ptr<GrFragmentProcessor> GrDeviceSpaceTextureDecalFragmentProcessor: } GrDeviceSpaceTextureDecalFragmentProcessor::GrDeviceSpaceTextureDecalFragmentProcessor( - sk_sp<GrTextureProxy> proxy, - const SkIRect& subset, - const SkIPoint& deviceSpaceOffset) + sk_sp<GrTextureProxy> proxy, const SkIRect& subset, const SkIPoint& deviceSpaceOffset) : INHERITED(kCompatibleWithCoverageAsAlpha_OptimizationFlag) - , fTextureSampler(proxy, GrSamplerParams::ClampNoFilter()) + , fTextureSampler(proxy, GrSamplerState::ClampNearest()) , fTextureDomain(proxy.get(), GrTextureDomain::MakeTexelDomain(subset), GrTextureDomain::kDecal_Mode) { this->addTextureSampler(&fTextureSampler); |