From 60dd8c746428fb6218fff5f437b1b7c5256bba13 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Mon, 30 Jul 2018 10:24:13 -0400 Subject: 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 Commit-Queue: Brian Salomon --- src/gpu/glsl/GrGLSLProgramBuilder.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/gpu/glsl/GrGLSLProgramBuilder.cpp') 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) { -- cgit v1.2.3