Index: src/gpu/gl/GrGpuGL.cpp |
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp |
index 149025aa0d9606fc718176ca48f722394712b542..98db317109d79c8360eaa1d7ef5848f82a420c47 100644 |
--- a/src/gpu/gl/GrGpuGL.cpp |
+++ b/src/gpu/gl/GrGpuGL.cpp |
@@ -966,15 +966,16 @@ GrTexture* GrGpuGL::onCreateTexture(const GrTextureDesc& desc, |
GrGLTexture::TexParams initialTexParams; |
// we only set a subset here so invalidate first |
initialTexParams.invalidate(); |
- initialTexParams.fFilter = GR_GL_NEAREST; |
+ initialTexParams.fMinFilter = GR_GL_NEAREST; |
+ initialTexParams.fMagFilter = GR_GL_NEAREST; |
initialTexParams.fWrapS = GR_GL_CLAMP_TO_EDGE; |
initialTexParams.fWrapT = GR_GL_CLAMP_TO_EDGE; |
GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, |
GR_GL_TEXTURE_MAG_FILTER, |
- initialTexParams.fFilter)); |
+ initialTexParams.fMagFilter)); |
GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, |
GR_GL_TEXTURE_MIN_FILTER, |
- initialTexParams.fFilter)); |
+ initialTexParams.fMinFilter)); |
GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, |
GR_GL_TEXTURE_WRAP_S, |
initialTexParams.fWrapS)); |
@@ -2016,12 +2017,18 @@ void GrGpuGL::bindTexture(int unitIdx, const GrTextureParams& params, GrGLTextur |
bool setAll = timestamp < this->getResetTimestamp(); |
GrGLTexture::TexParams newTexParams; |
- static GrGLenum glFilterModes[] = { |
+ static GrGLenum glMinFilterModes[] = { |
GR_GL_NEAREST, |
GR_GL_LINEAR, |
GR_GL_LINEAR_MIPMAP_LINEAR |
}; |
- newTexParams.fFilter = glFilterModes[params.filterMode()]; |
+ static GrGLenum glMagFilterModes[] = { |
+ GR_GL_NEAREST, |
+ GR_GL_LINEAR, |
+ GR_GL_LINEAR |
+ }; |
+ newTexParams.fMinFilter = glMinFilterModes[params.filterMode()]; |
+ newTexParams.fMagFilter = glMagFilterModes[params.filterMode()]; |
#ifndef SKIA_IGNORE_GPU_MIPMAPS |
if (params.filterMode() == GrTextureParams::kMipMap_FilterMode && |
@@ -2037,14 +2044,17 @@ void GrGpuGL::bindTexture(int unitIdx, const GrTextureParams& params, GrGLTextur |
memcpy(newTexParams.fSwizzleRGBA, |
GrGLShaderBuilder::GetTexParamSwizzle(texture->config(), this->glCaps()), |
sizeof(newTexParams.fSwizzleRGBA)); |
- if (setAll || newTexParams.fFilter != oldTexParams.fFilter) { |
+ if (setAll || newTexParams.fMagFilter != oldTexParams.fMagFilter) { |
this->setTextureUnit(unitIdx); |
GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, |
GR_GL_TEXTURE_MAG_FILTER, |
- newTexParams.fFilter)); |
+ newTexParams.fMagFilter)); |
+ } |
+ if (setAll || newTexParams.fMinFilter != oldTexParams.fMinFilter) { |
+ this->setTextureUnit(unitIdx); |
GL_CALL(TexParameteri(GR_GL_TEXTURE_2D, |
GR_GL_TEXTURE_MIN_FILTER, |
- newTexParams.fFilter)); |
+ newTexParams.fMinFilter)); |
} |
if (setAll || newTexParams.fWrapS != oldTexParams.fWrapS) { |
this->setTextureUnit(unitIdx); |