Bug 1371190 - Part5: Force enable alpha channel to prevent ANGLE from using incompatible backbuffer format
MozReview-Commit-ID: JtbKebUiroM
--- a/dom/canvas/WebGLContext.cpp
+++ b/dom/canvas/WebGLContext.cpp
@@ -759,18 +759,22 @@ WebGLContext::CreateAndInitGL(bool force
return CreateAndInitGLWith(CreateGLWithEGL, baseCaps, flags, out_failReasons);
if (CreateAndInitGLWith(CreateGLWithDefault, baseCaps, flags, out_failReasons))
return true;
}
//////
- if (tryANGLE)
- return CreateAndInitGLWith(CreateGLWithANGLE, baseCaps, flags, out_failReasons);
+ if (tryANGLE) {
+ // Force enable alpha channel to make sure ANGLE use correct framebuffer formart
+ gl::SurfaceCaps& angleCaps = const_cast<gl::SurfaceCaps&>(baseCaps);
+ angleCaps.alpha = true;
+ return CreateAndInitGLWith(CreateGLWithANGLE, angleCaps, flags, out_failReasons);
+ }
//////
out_failReasons->push_back(FailureReason("FEATURE_FAILURE_WEBGL_EXHAUSTED_DRIVERS",
"Exhausted GL driver options."));
return false;
}