diff options
author | Brian Salomon <bsalomon@google.com> | 2018-07-30 10:24:13 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-30 14:54:25 +0000 |
commit | 60dd8c746428fb6218fff5f437b1b7c5256bba13 (patch) | |
tree | bc9c5c5b16de0ecf6d60452d69dbfd870126f97a /src/gpu/glsl/GrGLSLProgramBuilder.cpp | |
parent | 12e42565886ac6b28cbcae40d63ee093bde3e630 (diff) |
Introduce enum class for texture type.
This represents the GL texture "target" but at the API-neutral level. It
will be needed here because proxy's that wrap imported texture's need to
know about sampling restrictions.
Change-Id: Ie811a6f6d04ba1b04faa6908422dca64e8e447c8
Reviewed-on: https://skia-review.googlesource.com/144304
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/glsl/GrGLSLProgramBuilder.cpp')
-rw-r--r-- | src/gpu/glsl/GrGLSLProgramBuilder.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp index 6f05eba0f6..05b78eef0c 100644 --- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp +++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp @@ -226,10 +226,10 @@ void GrGLSLProgramBuilder::emitAndInstallXferProc(const SkString& colorIn, // GrProcessor::TextureSampler sampler(dstTexture); SkString name("DstTextureSampler"); dstTextureSamplerHandle = - this->emitSampler(dstTexture->texturePriv().samplerType(), dstTexture->config(), + this->emitSampler(dstTexture->texturePriv().textureType(), dstTexture->config(), "DstTextureSampler", kFragment_GrShaderFlag); dstTextureOrigin = fPipeline.dstTextureProxy()->origin(); - SkASSERT(kTextureExternalSampler_GrSLType != dstTexture->texturePriv().samplerType()); + SkASSERT(dstTexture->texturePriv().textureType() != GrTextureType::kExternal); } GrGLSLXferProcessor::EmitArgs args(&fFS, @@ -258,9 +258,9 @@ void GrGLSLProgramBuilder::emitSamplers( for (int t = 0; t < numTextureSamplers; ++t) { const GrResourceIOProcessor::TextureSampler& sampler = processor.textureSampler(t); name.printf("TextureSampler_%d", outTexSamplerHandles->count()); - GrSLType samplerType = sampler.peekTexture()->texturePriv().samplerType(); + GrTextureType textureType = sampler.peekTexture()->texturePriv().textureType(); outTexSamplerHandles->emplace_back(this->emitSampler( - samplerType, sampler.peekTexture()->config(), name.c_str(), sampler.visibility())); + textureType, sampler.peekTexture()->config(), name.c_str(), sampler.visibility())); } } @@ -277,14 +277,14 @@ void GrGLSLProgramBuilder::updateSamplerCounts(GrShaderFlags visibility) { } } -GrGLSLProgramBuilder::SamplerHandle GrGLSLProgramBuilder::emitSampler(GrSLType samplerType, +GrGLSLProgramBuilder::SamplerHandle GrGLSLProgramBuilder::emitSampler(GrTextureType textureType, GrPixelConfig config, const char* name, GrShaderFlags visibility) { this->updateSamplerCounts(visibility); GrSLPrecision precision = GrSLSamplerPrecision(config); GrSwizzle swizzle = this->shaderCaps()->configTextureSwizzle(config); - return this->uniformHandler()->addSampler(visibility, swizzle, samplerType, precision, name); + return this->uniformHandler()->addSampler(visibility, swizzle, textureType, precision, name); } void GrGLSLProgramBuilder::emitFSOutputSwizzle(bool hasSecondaryOutput) { |