Bug 1287653 - Blacklist dx_interop2. - r=milan

MozReview-Commit-ID: GYyUIXYvcp1
This commit is contained in:
Jeff Gilbert 2016-07-28 19:44:58 -07:00
Родитель d75c500c1e
Коммит ccacf66a5e
5 изменённых файлов: 47 добавлений и 6 удалений

Просмотреть файл

@ -214,12 +214,24 @@ WGLLibrary::EnsureInitialized()
}
}
if (HasExtension(extString, "WGL_NV_DX_interop")) {
if (GLLibraryLoader::LoadSymbols(mOGLLibrary, &dxInteropSymbols[0], lookupFunc)) {
mHasDXInterop = true;
////
mHasDXInterop = HasExtension(extString, "WGL_NV_DX_interop");
mHasDXInterop2 = HasExtension(extString, "WGL_NV_DX_interop2");
} else {
NS_ERROR("WGL supports NV_DX_interop without supplying its functions.");
nsCString blocklistId;
if (gfxUtils::IsFeatureBlacklisted(nullptr, nsIGfxInfo::FEATURE_DX_INTEROP2,
&blocklistId) &&
!gfxPrefs::IgnoreDXInterop2Blacklist())
{
mHasDXInterop2 = false;
}
if (mHasDXInterop || mHasDXInterop2) {
if (!GLLibraryLoader::LoadSymbols(mOGLLibrary, &dxInteropSymbols[0],
lookupFunc))
{
NS_ERROR("WGL supports NV_DX_interop(2) without supplying its functions.");
fDXSetResourceShareHandle = nullptr;
fDXOpenDevice = nullptr;
fDXCloseDevice = nullptr;
@ -228,6 +240,9 @@ WGLLibrary::EnsureInitialized()
fDXObjectAccess = nullptr;
fDXLockObjects = nullptr;
fDXUnlockObjects = nullptr;
mHasDXInterop = false;
mHasDXInterop2 = false;
}
}
}

Просмотреть файл

@ -414,6 +414,7 @@ private:
DECL_GFX_PREF(Live, "gl.multithreaded", GLMultithreaded, bool, false);
#endif
DECL_GFX_PREF(Live, "gl.require-hardware", RequireHardwareGL, bool, false);
DECL_GFX_PREF(Live, "ignore-dx-interop2-blacklist", IgnoreDXInterop2Blacklist, bool, false);
DECL_GFX_PREF(Once, "image.cache.size", ImageCacheSize, int32_t, 5*1024*1024);
DECL_GFX_PREF(Once, "image.cache.timeweight", ImageCacheTimeWeight, int32_t, 500);

Просмотреть файл

@ -1428,6 +1428,25 @@ gfxUtils::ThreadSafeGetFeatureStatus(const nsCOMPtr<nsIGfxInfo>& gfxInfo,
return gfxInfo->GetFeatureStatus(feature, failureId, status);
}
/* static */ bool
gfxUtils::IsFeatureBlacklisted(nsCOMPtr<nsIGfxInfo> gfxInfo, int32_t feature,
nsACString* const out_blacklistId)
{
if (!gfxInfo) {
gfxInfo = services::GetGfxInfo();
}
int32_t status;
if (!NS_SUCCEEDED(gfxUtils::ThreadSafeGetFeatureStatus(gfxInfo, feature,
*out_blacklistId, &status)))
{
out_blacklistId->AssignLiteral("");
return true;
}
return status != nsIGfxInfo::FEATURE_STATUS_OK;
}
/* static */ bool
gfxUtils::DumpDisplayList() {
return gfxPrefs::LayoutDumpDisplayList() ||

Просмотреть файл

@ -268,6 +268,11 @@ public:
nsACString& failureId,
int32_t* status);
// Can pass `nullptr` for gfxInfo.
// If FAILED(ThreadSafeGetFeatureStatus), out_blacklistId will be empty.
static bool IsFeatureBlacklisted(nsCOMPtr<nsIGfxInfo> gfxInfo, int32_t feature,
nsACString* const out_blacklistId);
/**
* Copy to the clipboard as a PNG encoded Data URL.
*/

Просмотреть файл

@ -4400,6 +4400,7 @@ pref("gl.require-hardware", false);
#ifdef XP_MACOSX
pref("gl.multithreaded", true);
#endif
pref("gl.ignore-dx-interop2-blacklist", false);
pref("webgl.force-enabled", false);
pref("webgl.disabled", false);