зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1373739 - Disable WebGL in headless mode. r=bdahl
MozReview-Commit-ID: LWe9hRh7zXX --HG-- extra : rebase_source : b97091b65b22e616fa6b99b819216b5b3f9c5b66
This commit is contained in:
Родитель
325b9a25eb
Коммит
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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче