зеркало из https://github.com/mozilla/gecko-dev.git
Bug 818766 - disable by default losing WebGL contexts on heap-minimize, add a pref for it - r=jgilbert
This commit is contained in:
Родитель
3a3fa8c5ca
Коммит
406c738bbd
|
@ -595,3 +595,7 @@ pref("memory.free_dirty_pages", true);
|
|||
// UAProfile settings
|
||||
pref("wap.UAProf.url", "");
|
||||
pref("wap.UAProf.tagname", "x-wap-profile");
|
||||
|
||||
// b2g currently triggers heap-minimize more often than we want to lose WebGL contexts.
|
||||
// Until this is resolved, let's not lost WebGL contexts on heap-minimize. See bug 818766.
|
||||
pref("webgl.lose-context-on-heap-minimize", false);
|
||||
|
|
|
@ -58,9 +58,18 @@ WebGLMemoryPressureObserver::Observe(nsISupports* aSubject,
|
|||
const char* aTopic,
|
||||
const PRUnichar* aSomeData)
|
||||
{
|
||||
if (strcmp(aTopic, "memory-pressure") == 0)
|
||||
mContext->ForceLoseContext();
|
||||
return NS_OK;
|
||||
if (strcmp(aTopic, "memory-pressure"))
|
||||
return NS_OK;
|
||||
|
||||
bool wantToLoseContext = true;
|
||||
|
||||
if (!nsCRT::strcmp(aSomeData, NS_LITERAL_STRING("heap-minimize").get()))
|
||||
wantToLoseContext = mContext->mLoseContextOnHeapMinimize;
|
||||
|
||||
if (wantToLoseContext)
|
||||
mContext->ForceLoseContext();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -168,6 +177,7 @@ WebGLContext::WebGLContext()
|
|||
mContextRestorer = do_CreateInstance("@mozilla.org/timer;1");
|
||||
mContextStatus = ContextStable;
|
||||
mContextLostErrorSet = false;
|
||||
mLoseContextOnHeapMinimize = false;
|
||||
|
||||
mAlreadyGeneratedWarnings = 0;
|
||||
mAlreadyWarnedAboutFakeVertexAttrib0 = false;
|
||||
|
|
|
@ -843,6 +843,7 @@ protected:
|
|||
bool mDisableExtensions;
|
||||
bool mHasRobustness;
|
||||
bool mIsMesa;
|
||||
bool mLoseContextOnHeapMinimize;
|
||||
|
||||
template<typename WebGLObjectType>
|
||||
void DeleteWebGLObjectsArray(nsTArray<WebGLObjectType>& array);
|
||||
|
|
|
@ -852,6 +852,7 @@ WebGLContext::InitAndValidateGL()
|
|||
|
||||
mMinCapability = Preferences::GetBool("webgl.min_capability_mode", false);
|
||||
mDisableExtensions = Preferences::GetBool("webgl.disable-extensions", false);
|
||||
mLoseContextOnHeapMinimize = Preferences::GetBool("webgl.lose-context-on-heap-minimize", false);
|
||||
|
||||
mActiveTexture = 0;
|
||||
mWebGLError = LOCAL_GL_NO_ERROR;
|
||||
|
|
|
@ -3665,6 +3665,7 @@ pref("webgl.msaa-force", false);
|
|||
pref("webgl.prefer-16bpp", false);
|
||||
pref("webgl.default-no-alpha", false);
|
||||
pref("webgl.force-layers-readback", false);
|
||||
pref("webgl.lose-context-on-heap-minimize", true);
|
||||
|
||||
// Stagefright prefs
|
||||
pref("stagefright.force-enabled", false);
|
||||
|
|
Загрузка…
Ссылка в новой задаче