diff --git a/content/canvas/src/WebGLContext.cpp b/content/canvas/src/WebGLContext.cpp index 42ffd8b8242..89f4a795f60 100644 --- a/content/canvas/src/WebGLContext.cpp +++ b/content/canvas/src/WebGLContext.cpp @@ -473,41 +473,6 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height) } #endif - -#ifdef ANDROID - // bug 736123, blacklist WebGL on Adreno - // - // The Adreno driver in WebGL context creation, specifically in the first MakeCurrent - // call on the newly created OpenGL context. - // - // Notice that we can't rely on GfxInfo for this blacklisting, - // as GfxInfo on Android currently doesn't know the GL strings, which are, - // AFAIK, the only way to identify Adreno GPUs. - // - // Somehow, the Layers' OpenGL context creation doesn't crash, and neither does - // the global GL context creation. So we currently use the Renderer() id from the - // global context. This is not future-proof, as the plan is to get rid of the global - // context soon with OMTC. We need to replace this by getting the renderer id from - // the Layers' GL context, but as with OMTC the LayerManager lives on a different - // thread, this will have to involve some message-passing. - if (!forceEnabled) { - GLContext *globalContext = GLContextProvider::GetGlobalContext(); - if (!globalContext) { - // make sure that we don't forget to update this code once the globalContext - // is removed - NS_RUNTIMEABORT("No global context anymore? Then you need to update " - "this code, or force-enable WebGL."); - } - int renderer = globalContext->Renderer(); - if (renderer == gl::GLContext::RendererAdreno200 || - renderer == gl::GLContext::RendererAdreno205) - { - GenerateWarning("WebGL blocked on this Adreno driver!"); - return NS_ERROR_FAILURE; - } - } -#endif - // if we're forcing osmesa, do it first if (forceOSMesa) { gl = gl::GLContextProviderOSMesa::CreateOffscreen(gfxIntSize(width, height), format); diff --git a/content/canvas/src/WebGLContextValidate.cpp b/content/canvas/src/WebGLContextValidate.cpp index 8fc12f8265f..213b596bfbc 100644 --- a/content/canvas/src/WebGLContextValidate.cpp +++ b/content/canvas/src/WebGLContextValidate.cpp @@ -597,6 +597,20 @@ WebGLContext::InitAndValidateGL() return false; } +#ifdef ANDROID + // bug 736123, blacklist WebGL on Adreno + bool forceEnabled = Preferences::GetBool("webgl.force-enabled", false); + if (!forceEnabled) { + int renderer = gl->Renderer(); + if (renderer == gl::GLContext::RendererAdreno200 || + renderer == gl::GLContext::RendererAdreno205) + { + GenerateWarning("WebGL blocked on this Adreno driver!"); + return false; + } + } +#endif + mMinCapability = Preferences::GetBool("webgl.min_capability_mode", false); mDisableExtensions = Preferences::GetBool("webgl.disable-extensions", false);