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

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

Issue 1750833003: Disabling calls to TexParameteri when the values do not exist on ES2. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | no next file » | 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 29841331c01d308d45b7c1948db0dfe54547a4a6..d58a961adcbfe7392871fc82fd6cc42b3bb29996 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -3344,14 +3344,17 @@ void GrGLGpu::bindTexture(int unitIdx, const GrTextureParams& params, GrGLTextur
GL_CALL(TexParameteri(target, GR_GL_TEXTURE_MIN_FILTER, newTexParams.fMinFilter));
}
if (setAll || newTexParams.fMaxMipMapLevel != oldTexParams.fMaxMipMapLevel) {
- if (newTexParams.fMaxMipMapLevel != 0) {
- this->setTextureUnit(unitIdx);
- GL_CALL(TexParameteri(target, GR_GL_TEXTURE_MIN_LOD, 0));
- GL_CALL(TexParameteri(target, GR_GL_TEXTURE_BASE_LEVEL, 0));
- GL_CALL(TexParameteri(target, GR_GL_TEXTURE_MAX_LOD,
- newTexParams.fMaxMipMapLevel));
- GL_CALL(TexParameteri(target, GR_GL_TEXTURE_MAX_LEVEL,
- newTexParams.fMaxMipMapLevel));
+ // These are not supported in ES2 contexts
+ if (this->glStandard() != kGLES_GrGLStandard && this->glVersion() != GR_GL_VER(2,0)) {
bsalomon 2016/03/01 14:21:16 Can we make this a cap? Maybe mipMapLevelAndLodCon
cblume 2016/03/01 21:36:51 Done.
+ if (newTexParams.fMaxMipMapLevel != 0) {
+ this->setTextureUnit(unitIdx);
+ GL_CALL(TexParameteri(target, GR_GL_TEXTURE_MIN_LOD, 0));
+ GL_CALL(TexParameteri(target, GR_GL_TEXTURE_BASE_LEVEL, 0));
+ GL_CALL(TexParameteri(target, GR_GL_TEXTURE_MAX_LOD,
+ newTexParams.fMaxMipMapLevel));
+ GL_CALL(TexParameteri(target, GR_GL_TEXTURE_MAX_LEVEL,
+ newTexParams.fMaxMipMapLevel));
+ }
}
}
if (setAll || newTexParams.fWrapS != oldTexParams.fWrapS) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698