зеркало из https://github.com/mozilla/pjs.git
Bug 546514 - Part 5: Allow turning on D3D10 layers through a pref. r=vlad a=vlad
This commit is contained in:
Родитель
d92a40f052
Коммит
5574799cc5
|
@ -3229,6 +3229,7 @@ pref("gfx.direct2d.disabled", false);
|
|||
pref("gfx.direct2d.force-enabled", false);
|
||||
|
||||
pref("layers.prefer-opengl", false);
|
||||
pref("layers.use-d3d10", false);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -174,6 +174,9 @@
|
|||
#ifdef MOZ_ENABLE_D3D9_LAYER
|
||||
#include "LayerManagerD3D9.h"
|
||||
#endif
|
||||
#ifdef MOZ_ENABLE_D3D10_LAYER
|
||||
#include "LayerManagerD3D10.h"
|
||||
#endif
|
||||
#include "LayerManagerOGL.h"
|
||||
#endif
|
||||
#include "BasicLayers.h"
|
||||
|
@ -3185,6 +3188,7 @@ nsWindow::GetLayerManager()
|
|||
PRBool accelerateByDefault = PR_TRUE;
|
||||
PRBool disableAcceleration = PR_FALSE;
|
||||
PRBool preferOpenGL = PR_FALSE;
|
||||
PRBool useD3D10 = PR_FALSE;
|
||||
if (prefs) {
|
||||
prefs->GetBoolPref("layers.accelerate-all",
|
||||
&accelerateByDefault);
|
||||
|
@ -3192,6 +3196,8 @@ nsWindow::GetLayerManager()
|
|||
&disableAcceleration);
|
||||
prefs->GetBoolPref("layers.prefer-opengl",
|
||||
&preferOpenGL);
|
||||
prefs->GetBoolPref("layers.use-d3d10",
|
||||
&useD3D10);
|
||||
}
|
||||
|
||||
const char *acceleratedEnv = PR_GetEnv("MOZ_ACCELERATED");
|
||||
|
@ -3215,8 +3221,17 @@ nsWindow::GetLayerManager()
|
|||
mUseAcceleratedRendering = PR_TRUE;
|
||||
|
||||
if (mUseAcceleratedRendering) {
|
||||
#ifdef MOZ_ENABLE_D3D10_LAYER
|
||||
if (useD3D10) {
|
||||
nsRefPtr<mozilla::layers::LayerManagerD3D10> layerManager =
|
||||
new mozilla::layers::LayerManagerD3D10(this);
|
||||
if (layerManager->Initialize()) {
|
||||
mLayerManager = layerManager;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef MOZ_ENABLE_D3D9_LAYER
|
||||
if (!preferOpenGL) {
|
||||
if (!preferOpenGL && !mLayerManager) {
|
||||
nsRefPtr<mozilla::layers::LayerManagerD3D9> layerManager =
|
||||
new mozilla::layers::LayerManagerD3D9(this);
|
||||
if (layerManager->Initialize()) {
|
||||
|
|
|
@ -759,6 +759,11 @@ DDRAW_FAILED:
|
|||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifdef MOZ_ENABLE_D3D10_LAYER
|
||||
case LayerManager::LAYERS_D3D10:
|
||||
result = DispatchWindowEvent(&event, eventStatus);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
NS_ERROR("Unknown layers backend used!");
|
||||
|
|
Загрузка…
Ссылка в новой задаче