Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 2143143002: Add Texture2D and Sampler GrSLTypes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nits Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrTypesPriv.h ('k') | src/gpu/gl/GrGLProgramDesc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 99726904873a4f5df4b5feecaa909fc68d2a5fb9..780c294c18022fc5d6874be48a31a2c24be1eb23 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -336,7 +336,8 @@ bool GrGLGpu::createPLSSetupProgram() {
GrGLSLShaderVar uTexCoordXform("u_texCoordXform", kVec4f_GrSLType,
GrShaderVar::kUniform_TypeModifier);
GrGLSLShaderVar uPosXform("u_posXform", kVec4f_GrSLType, GrShaderVar::kUniform_TypeModifier);
- GrGLSLShaderVar uTexture("u_texture", kSampler2D_GrSLType, GrShaderVar::kUniform_TypeModifier);
+ GrGLSLShaderVar uTexture("u_texture", kTexture2DSampler_GrSLType,
+ GrShaderVar::kUniform_TypeModifier);
GrGLSLShaderVar vTexCoord("v_texCoord", kVec2f_GrSLType, GrShaderVar::kVaryingOut_TypeModifier);
SkString vshaderTxt(version);
@@ -3629,13 +3630,14 @@ bool GrGLGpu::onCopySurface(GrSurface* dst,
bool GrGLGpu::createCopyProgram(int progIdx) {
const GrGLSLCaps* glslCaps = this->glCaps().glslCaps();
- static const GrSLType kSamplerTypes[3] = { kSampler2D_GrSLType, kSamplerExternal_GrSLType,
- kSampler2DRect_GrSLType };
- if (kSamplerExternal_GrSLType == kSamplerTypes[progIdx] &&
+ static const GrSLType kSamplerTypes[3] = { kTexture2DSampler_GrSLType,
+ kTextureExternalSampler_GrSLType,
+ kTexture2DRectSampler_GrSLType };
+ if (kTextureExternalSampler_GrSLType == kSamplerTypes[progIdx] &&
!this->glCaps().glslCaps()->externalTextureSupport()) {
return false;
}
- if (kSampler2DRect_GrSLType == kSamplerTypes[progIdx] &&
+ if (kTexture2DRectSampler_GrSLType == kSamplerTypes[progIdx] &&
!this->glCaps().rectangleTextureSupport()) {
return false;
}
@@ -3705,7 +3707,7 @@ bool GrGLGpu::createCopyProgram(int progIdx) {
fshaderTxt.appendf("#extension %s : require\n", extension);
}
}
- if (kSamplerTypes[progIdx] == kSamplerExternal_GrSLType) {
+ if (kSamplerTypes[progIdx] == kTextureExternalSampler_GrSLType) {
fshaderTxt.appendf("#extension %s : require\n",
glslCaps->externalTextureExtensionString());
}
@@ -3782,7 +3784,8 @@ bool GrGLGpu::createMipmapProgram(int progIdx) {
GrGLSLShaderVar aVertex("a_vertex", kVec2f_GrSLType, GrShaderVar::kAttribute_TypeModifier);
GrGLSLShaderVar uTexCoordXform("u_texCoordXform", kVec4f_GrSLType,
GrShaderVar::kUniform_TypeModifier);
- GrGLSLShaderVar uTexture("u_texture", kSampler2D_GrSLType, GrShaderVar::kUniform_TypeModifier);
+ GrGLSLShaderVar uTexture("u_texture", kTexture2DSampler_GrSLType,
+ GrShaderVar::kUniform_TypeModifier);
// We need 1, 2, or 4 texture coordinates (depending on parity of each dimension):
GrGLSLShaderVar vTexCoords[] = {
GrGLSLShaderVar("v_texCoord0", kVec2f_GrSLType, GrShaderVar::kVaryingOut_TypeModifier),
@@ -3869,7 +3872,8 @@ bool GrGLGpu::createMipmapProgram(int progIdx) {
} else {
fsOutName = "gl_FragColor";
}
- const char* sampleFunction = GrGLSLTexture2DFunctionName(kVec2f_GrSLType, kSampler2D_GrSLType,
+ const char* sampleFunction = GrGLSLTexture2DFunctionName(kVec2f_GrSLType,
+ kTexture2DSampler_GrSLType,
this->glslGeneration());
fshaderTxt.append(
"// Mipmap Program FS\n"
« no previous file with comments | « include/gpu/GrTypesPriv.h ('k') | src/gpu/gl/GrGLProgramDesc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698