mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1373739 - Disable WebGL in headless mode. r=bdahl
MozReview-Commit-ID: LWe9hRh7zXX --HG-- extra : rebase_source : b97091b65b22e616fa6b99b819216b5b3f9c5b66
This commit is contained in:
parent
325b9a25eb
commit
f0a3973e54
@ -681,6 +681,15 @@ bool
|
||||
WebGLContext::CreateAndInitGL(bool forceEnabled,
|
||||
std::vector<FailureReason>* const out_failReasons)
|
||||
{
|
||||
// Can't use WebGL in headless mode.
|
||||
if (gfxPlatform::IsHeadless()) {
|
||||
FailureReason reason;
|
||||
reason.info = "Can't use WebGL in headless mode (https://bugzil.la/1375585).";
|
||||
out_failReasons->push_back(reason);
|
||||
GenerateWarning("%s", reason.info.BeginReading());
|
||||
return false;
|
||||
}
|
||||
|
||||
// WebGL2 is separately blocked:
|
||||
if (IsWebGL2()) {
|
||||
const nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
|
||||
|
@ -110,8 +110,13 @@
|
||||
test(function() {
|
||||
var c = self[0].document.createElement("canvas"),
|
||||
obj = c.getContext(val)
|
||||
assert_global(obj)
|
||||
|
||||
// WebGL might not be enabled in this environment
|
||||
if (!obj && val === "webgl") {
|
||||
return;
|
||||
}
|
||||
|
||||
assert_global(obj)
|
||||
obj = HTMLCanvasElement.prototype.getContext.call(c, val)
|
||||
assert_global(obj)
|
||||
}, "getContext " + val)
|
||||
|
Loading…
Reference in New Issue
Block a user