diff options
author | Robert Phillips <robertphillips@google.com> | 2017-02-22 15:28:38 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-02-23 15:01:42 +0000 |
commit | 30f9bc69cfc506075e1fce8e7934f941c0203023 (patch) | |
tree | f15f11bcb790206acaff8bfe6bb881eb254bec39 /src/gpu/GrProcessor.cpp | |
parent | bcfb8f639e516b673b6dbda41900efac69be2daf (diff) |
Switch GrTextureStripAtlas over to GrTextureProxies
This is split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors)
Change-Id: I9f602985b6010fc58b595e2be6d4e67e50179747
Reviewed-on: https://skia-review.googlesource.com/8881
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrProcessor.cpp')
-rw-r--r-- | src/gpu/GrProcessor.cpp | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp index 663527e3e5..8214d2c416 100644 --- a/src/gpu/GrProcessor.cpp +++ b/src/gpu/GrProcessor.cpp @@ -211,9 +211,7 @@ GrProcessor::TextureSampler::TextureSampler(GrTexture* texture, GrProcessor::TextureSampler::TextureSampler(GrTextureProvider* texProvider, sk_sp<GrTextureProxy> proxy, const GrSamplerParams& params) { - // For now, end the deferral at this time. Once all the TextureSamplers are swapped over - // to taking a GrSurfaceProxy just use the IORefs on the proxy - this->reset(proxy->instantiate(texProvider), params); + this->reset(texProvider, std::move(proxy), params); } GrProcessor::TextureSampler::TextureSampler(GrTextureProvider* texProvider, @@ -221,9 +219,7 @@ GrProcessor::TextureSampler::TextureSampler(GrTextureProvider* texProvider, GrSamplerParams::FilterMode filterMode, SkShader::TileMode tileXAndY, GrShaderFlags visibility) { - // For now, end the deferral at this time. Once all the TextureSamplers are swapped over - // to taking a GrSurfaceProxy just use the IORefs on the proxy - this->reset(proxy->instantiate(texProvider), filterMode, tileXAndY, visibility); + this->reset(texProvider, std::move(proxy), filterMode, tileXAndY, visibility); } void GrProcessor::TextureSampler::reset(GrTexture* texture, @@ -247,6 +243,35 @@ void GrProcessor::TextureSampler::reset(GrTexture* texture, fVisibility = visibility; } +void GrProcessor::TextureSampler::reset(GrTextureProvider* texProvider, + sk_sp<GrTextureProxy> proxy, + const GrSamplerParams& params, + GrShaderFlags visibility) { + // For now, end the deferral at this time. Once all the TextureSamplers are swapped over + // to taking a GrSurfaceProxy just use the IORefs on the proxy + GrTexture* texture = proxy->instantiate(texProvider); + SkASSERT(texture); + fTexture.set(SkRef(texture), kRead_GrIOType); + fParams = params; + fParams.setFilterMode(SkTMin(params.filterMode(), texture->texturePriv().highestFilterMode())); + fVisibility = visibility; +} + +void GrProcessor::TextureSampler::reset(GrTextureProvider* texProvider, + sk_sp<GrTextureProxy> proxy, + GrSamplerParams::FilterMode filterMode, + SkShader::TileMode tileXAndY, + GrShaderFlags visibility) { + // For now, end the deferral at this time. Once all the TextureSamplers are swapped over + // to taking a GrSurfaceProxy just use the IORefs on the proxy + GrTexture* texture = proxy->instantiate(texProvider); + SkASSERT(texture); + fTexture.set(SkRef(texture), kRead_GrIOType); + filterMode = SkTMin(filterMode, texture->texturePriv().highestFilterMode()); + fParams.reset(tileXAndY, filterMode); + fVisibility = visibility; +} + /////////////////////////////////////////////////////////////////////////////////////////////////// GrProcessor::ImageStorageAccess::ImageStorageAccess(sk_sp<GrTexture> texture, GrIOType ioType, |