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

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

Issue 102853005: Add detection of mip support (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove extra space Created 7 years 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 | « src/gpu/gl/GrGLCaps.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGpuGL.cpp
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 4b5221c31b52f68f6f1af05923c0fb850098afbe..7ab4bc1fcb0ca76d87071a34f9ee89e27eb69bfd 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -2028,11 +2028,14 @@ void GrGpuGL::bindTexture(int unitIdx, const GrTextureParams& params, GrGLTextur
GR_GL_LINEAR,
GR_GL_LINEAR
};
- newTexParams.fMinFilter = glMinFilterModes[params.filterMode()];
- newTexParams.fMagFilter = glMagFilterModes[params.filterMode()];
+ GrTextureParams::FilterMode filterMode = params.filterMode();
+ if (!this->caps()->mipMapSupport() && GrTextureParams::kMipMap_FilterMode == filterMode) {
+ filterMode = GrTextureParams::kBilerp_FilterMode;
+ }
+ newTexParams.fMinFilter = glMinFilterModes[filterMode];
+ newTexParams.fMagFilter = glMagFilterModes[filterMode];
- if (params.filterMode() == GrTextureParams::kMipMap_FilterMode &&
- texture->mipMapsAreDirty()) {
+ if (GrTextureParams::kMipMap_FilterMode == filterMode && texture->mipMapsAreDirty()) {
// GL_CALL(Hint(GR_GL_GENERATE_MIPMAP_HINT,GR_GL_NICEST));
GL_CALL(GenerateMipmap(GR_GL_TEXTURE_2D));
texture->dirtyMipMaps(false);
« no previous file with comments | « src/gpu/gl/GrGLCaps.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698