зеркало из https://github.com/mozilla/pjs.git
Bug 628403 - introduce webgl.force-enabled and webgl.disabled prefs - r=vlad, a=joe
This commit is contained in:
Родитель
5f99e6c2e3
Коммит
e9cf37db6a
|
@ -402,10 +402,11 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
|
|||
PRBool forceOSMesa = PR_FALSE;
|
||||
PRBool preferEGL = PR_FALSE;
|
||||
PRBool preferOpenGL = PR_FALSE;
|
||||
PRBool forceEnabled = PR_FALSE;
|
||||
prefService->GetBoolPref("webgl.force_osmesa", &forceOSMesa);
|
||||
prefService->GetBoolPref("webgl.prefer_egl", &preferEGL);
|
||||
prefService->GetBoolPref("webgl.prefer_gl", &preferOpenGL);
|
||||
|
||||
prefService->GetBoolPref("webgl.force-enabled", &forceEnabled);
|
||||
if (PR_GetEnv("MOZ_WEBGL_PREFER_EGL")) {
|
||||
preferEGL = PR_TRUE;
|
||||
}
|
||||
|
@ -415,7 +416,7 @@ WebGLContext::SetDimensions(PRInt32 width, PRInt32 height)
|
|||
PRBool useANGLE = PR_TRUE;
|
||||
|
||||
nsCOMPtr<nsIGfxInfo> gfxInfo = do_GetService("@mozilla.org/gfx/info;1");
|
||||
if (gfxInfo) {
|
||||
if (gfxInfo && !forceEnabled) {
|
||||
PRInt32 status;
|
||||
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_WEBGL_OPENGL, &status))) {
|
||||
if (status != nsIGfxInfo::FEATURE_NO_INFO) {
|
||||
|
|
|
@ -89,9 +89,9 @@ WebGLContext::SafeToCreateCanvas3DContext(nsHTMLCanvasElement *canvasElement)
|
|||
nsCOMPtr<nsIPrefBranch> prefService = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, PR_FALSE);
|
||||
|
||||
PRBool allSites = PR_FALSE;
|
||||
rv = prefService->GetBoolPref("webgl.enabled_for_all_sites", &allSites);
|
||||
if (NS_SUCCEEDED(rv) && allSites) {
|
||||
PRBool disabled = PR_FALSE;
|
||||
rv = prefService->GetBoolPref("webgl.disabled", &disabled);
|
||||
if (NS_SUCCEEDED(rv) && !disabled) {
|
||||
// the all-sites pref was set, we're good to go
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
|
|
@ -45,14 +45,14 @@ function start() {
|
|||
return svc;
|
||||
}
|
||||
|
||||
function setEnabledForAllSites(value) {
|
||||
function setForceEnabled(value) {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
prefSvc().setBoolPref("webgl.enabled_for_all_sites", value);
|
||||
prefSvc().setBoolPref("webgl.force-enabled", value);
|
||||
}
|
||||
|
||||
function getEnabledForAllSites() {
|
||||
function getForceEnabled() {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
return prefSvc().getBoolPref("webgl.enabled_for_all_sites");
|
||||
return prefSvc().getBoolPref("webgl.force-enabled");
|
||||
}
|
||||
|
||||
function setPreferGL(value) {
|
||||
|
@ -70,7 +70,7 @@ function start() {
|
|||
}
|
||||
|
||||
function restoreOldPrefs() {
|
||||
setEnabledForAllSites(saved_enabled_for_all_sites);
|
||||
setForceEnabled(saved_force_enabled);
|
||||
setPreferGL(saved_prefer_gl);
|
||||
}
|
||||
|
||||
|
@ -296,7 +296,7 @@ function start() {
|
|||
var reporter = new Reporter();
|
||||
|
||||
// set WebGL-related preferences needed to run WebGL tests
|
||||
setEnabledForAllSites(true);
|
||||
setForceEnabled(true);
|
||||
|
||||
// XXX temporary hack. Until the DirectX runtime is deployed on test slaves, we just use OpenGL,
|
||||
// so that rel-eng can safely deploy DirectX runtime without getting sudden mochitest failures
|
||||
|
@ -383,7 +383,7 @@ function start() {
|
|||
}
|
||||
}
|
||||
|
||||
var saved_enabled_for_all_sites = getEnabledForAllSites();
|
||||
var saved_force_enabled = getForceEnabled();
|
||||
var saved_prefer_gl = getPreferGL();
|
||||
|
||||
var statusElem = document.getElementById("status");
|
||||
|
|
|
@ -3208,10 +3208,10 @@ pref("image.mem.max_ms_before_yield", 400);
|
|||
pref("image.mem.max_bytes_for_sync_decode", 150000);
|
||||
|
||||
// WebGL prefs
|
||||
pref("webgl.enabled_for_all_sites", true);
|
||||
pref("webgl.force-enabled", false);
|
||||
pref("webgl.disabled", false);
|
||||
pref("webgl.shader_validator", true);
|
||||
pref("webgl.force_osmesa", false);
|
||||
pref("webgl.mochitest_native_gl", false);
|
||||
pref("webgl.osmesalib", "");
|
||||
pref("webgl.verbose", false);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче