Bug 937204 - 1/3. Simplify the D3D9_LAYERS gfxinfo check and only run it on Windows - r=jrmuizel

This commit is contained in:
Benoit Jacob 2013-11-15 11:28:40 -05:00
Родитель 26b2b9594f
Коммит 98bafb9609
1 изменённых файлов: 13 добавлений и 7 удалений

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

@ -2030,7 +2030,7 @@ static bool sPrefLayersAccelerationForceEnabled = false;
static bool sPrefLayersAccelerationDisabled = false;
static bool sPrefLayersPreferOpenGL = false;
static bool sPrefLayersPreferD3D9 = false;
static bool sLayersSupportsD3D9 = true;
static bool sLayersSupportsD3D9 = false;
static int sPrefLayoutFrameRate = -1;
static bool sBufferRotationEnabled = false;
static bool sComponentAlphaEnabled = true;
@ -2055,15 +2055,21 @@ InitLayersAccelerationPrefs()
sComponentAlphaEnabled = Preferences::GetBool("layers.componentalpha.enabled", true);
sPrefBrowserTabsRemote = Preferences::GetBool("browser.tabs.remote", false);
nsCOMPtr<nsIGfxInfo> gfxInfo = do_GetService("@mozilla.org/gfx/info;1");
if (gfxInfo) {
int32_t status;
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DIRECT3D_9_LAYERS, &status))) {
if (status != nsIGfxInfo::FEATURE_NO_INFO && !sPrefLayersAccelerationForceEnabled) {
sLayersSupportsD3D9 = false;
#ifdef XP_WIN
if (sPrefLayersAccelerationForceEnabled) {
sLayersSupportsD3D9 = true;
} else {
nsCOMPtr<nsIGfxInfo> gfxInfo = do_GetService("@mozilla.org/gfx/info;1");
if (gfxInfo) {
int32_t status;
if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DIRECT3D_9_LAYERS, &status))) {
if (status == nsIGfxInfo::FEATURE_NO_INFO) {
sLayersSupportsD3D9 = true;
}
}
}
}
#endif
sLayersAccelerationPrefsInitialized = true;
}