From 085fec011703847beaa080fa617320a62bd8c0bc Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Thu, 29 Sep 2011 10:13:49 -0400 Subject: [PATCH] Bug 684882 - back out db67bdba5ca8 --- content/canvas/src/WebGLContext.h | 1 - content/canvas/src/WebGLContextGL.cpp | 21 --------------------- 2 files changed, 22 deletions(-) diff --git a/content/canvas/src/WebGLContext.h b/content/canvas/src/WebGLContext.h index a9bb297a923a..48d506bc6d19 100644 --- a/content/canvas/src/WebGLContext.h +++ b/content/canvas/src/WebGLContext.h @@ -1154,7 +1154,6 @@ public: mWrapT = aWrapT; SetDontKnowIfNeedFakeBlack(); } - WebGLenum MinFilter() const { return mMinFilter; } bool DoesMinFilterRequireMipmap() const { diff --git a/content/canvas/src/WebGLContextGL.cpp b/content/canvas/src/WebGLContextGL.cpp index f8a8f7c483ef..9c524b28e86d 100644 --- a/content/canvas/src/WebGLContextGL.cpp +++ b/content/canvas/src/WebGLContextGL.cpp @@ -1777,28 +1777,7 @@ WebGLContext::GenerateMipmap(WebGLenum target) tex->SetGeneratedMipmap(); MakeContextCurrent(); - -#ifdef XP_MACOSX - // On Mac, glGenerateMipmap on a texture whose minification filter does NOT require a mipmap at the time of the call, - // will happily grab random video memory into certain mipmap levels. See bug 684882. Also, this is Apple bug 9129398. - // Thanks to Kenneth Russell / Google for figuring this out. - // So we temporarily spoof the minification filter, call glGenerateMipmap, - // and restore it. If that turned out to not be enough, we would have to avoid calling glGenerateMipmap altogether and - // emulate it. - if (tex->DoesMinFilterRequireMipmap()) { - gl->fGenerateMipmap(target); - } else { - // spoof the min filter as something that requires a mipmap. The particular choice of a filter doesn't matter as - // we're not rendering anything here. Since LINEAR_MIPMAP_LINEAR is by far the most common use case, and we're trying - // to work around a bug triggered by "unexpected" min filters, it seems to be the safest choice. - gl->fTexParameteri(target, LOCAL_GL_TEXTURE_MIN_FILTER, LOCAL_GL_LINEAR_MIPMAP_LINEAR); - gl->fGenerateMipmap(target); - gl->fTexParameteri(target, LOCAL_GL_TEXTURE_MIN_FILTER, tex->MinFilter()); - } -#else gl->fGenerateMipmap(target); -#endif - return NS_OK; }