aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLGpu.cpp
diff options
context:
space:
mode:
authorGravatar cblume <cblume@chromium.org>2016-03-01 14:08:28 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-01 14:08:28 -0800
commit09bd2c09b6b36737df289fdb5fa38c280162cbb8 (patch)
tree76b2cf57c1bb6e5a6890b3b98f4c7e1a09624e0c /src/gpu/gl/GrGLGpu.cpp
parent5b9ad7620b36858f99fef0763d7fc04d024fd71d (diff)
Disabling calls to TexParameteri when the values do not exist on ES2.
Diffstat (limited to 'src/gpu/gl/GrGLGpu.cpp')
-rw-r--r--src/gpu/gl/GrGLGpu.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 29841331c0..dc50c1429c 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->glCaps().mipMapLevelAndLodControlSupport()) {
+ 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) {