Bug 736123 - blacklist Adreno renderers for WebGL - r=joe
authorBenoit Jacob <bjacob@mozilla.com>
Mon, 30 Apr 2012 17:43:12 -0400
changeset 92761 b16c77b3e8ec62fed092c718b6f47feb4476411b
parent 92760 34be9827bc854beac8d5f9f923ec54302ee3e46a
child 92762 934967d88037b70612ecceab2bc18481d5498ae2
push id8858
push userbjacob@mozilla.com
push dateMon, 30 Apr 2012 21:43:24 +0000
treeherdermozilla-inbound@4bb0aa38c2d4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoe
bugs736123
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 736123 - blacklist Adreno renderers for WebGL - r=joe
content/canvas/src/WebGLContextValidate.cpp
--- a/content/canvas/src/WebGLContextValidate.cpp
+++ b/content/canvas/src/WebGLContextValidate.cpp
@@ -513,16 +513,30 @@ WebGLContext::InitAndValidateGL()
     if (!gl) return false;
 
     GLenum error = gl->fGetError();
     if (error != LOCAL_GL_NO_ERROR) {
         LogMessage("GL error 0x%x occurred during OpenGL context initialization, before WebGL initialization!", error);
         return false;
     }
 
+#ifdef ANDROID
+    // bug 736123, blacklist WebGL on Adreno because they do not implement
+    // glTexSubImage2D in a way that is safe to expose to WebGL </euphemism>
+    // We don't rely on GfxInfo for this blacklisting, because GfxInfo on Android doesn't know
+    // about GL strings and GL strings are the only way I know to detect Adreno (EGL Vendor only
+    // says 'Android'), and it is not convenient to have to create a GL context before GfxInfo::Init()
+    // is first called.
+    if (gl->Renderer() == gl::GLContext::RendererAdreno200 ||
+        gl->Renderer() == gl::GLContext::RendererAdreno205)
+    {
+        return false;
+    }
+#endif
+
     mMinCapability = Preferences::GetBool("webgl.min_capability_mode", false);
     mDisableExtensions = Preferences::GetBool("webgl.disable-extensions", false);
 
     mActiveTexture = 0;
     mWebGLError = LOCAL_GL_NO_ERROR;
 
     mAttribBuffers.Clear();