зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1725854 - Check for the WebGPU pref before initializing the GPU process IPC side r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D125130
This commit is contained in:
Родитель
3590bbfc67
Коммит
45b533e45e
|
@ -29,21 +29,10 @@ namespace layers {
|
|||
class CompositorOptions {
|
||||
public:
|
||||
// This constructor needed for IPDL purposes, don't use it anywhere else.
|
||||
CompositorOptions()
|
||||
: mUseAPZ(false),
|
||||
mUseSoftwareWebRender(false),
|
||||
mAllowSoftwareWebRenderD3D11(false),
|
||||
mAllowSoftwareWebRenderOGL(false),
|
||||
mUseAdvancedLayers(false),
|
||||
mInitiallyPaused(false) {}
|
||||
CompositorOptions() = default;
|
||||
|
||||
CompositorOptions(bool aUseAPZ, bool aUseSoftwareWebRender)
|
||||
: mUseAPZ(aUseAPZ),
|
||||
mUseSoftwareWebRender(aUseSoftwareWebRender),
|
||||
mAllowSoftwareWebRenderD3D11(false),
|
||||
mAllowSoftwareWebRenderOGL(false),
|
||||
mUseAdvancedLayers(false),
|
||||
mInitiallyPaused(false) {}
|
||||
: mUseAPZ(aUseAPZ), mUseSoftwareWebRender(aUseSoftwareWebRender) {}
|
||||
|
||||
bool UseAPZ() const { return mUseAPZ; }
|
||||
bool UseSoftwareWebRender() const { return mUseSoftwareWebRender; }
|
||||
|
@ -68,6 +57,9 @@ class CompositorOptions {
|
|||
mUseAdvancedLayers = aUseAdvancedLayers;
|
||||
}
|
||||
|
||||
bool UseWebGPU() const { return mUseWebGPU; }
|
||||
void SetUseWebGPU(bool aUseWebGPU) { mUseWebGPU = aUseWebGPU; }
|
||||
|
||||
void SetInitiallyPaused(bool aPauseAtStartup) {
|
||||
mInitiallyPaused = aPauseAtStartup;
|
||||
}
|
||||
|
@ -78,18 +70,20 @@ class CompositorOptions {
|
|||
mAllowSoftwareWebRenderD3D11 ==
|
||||
aOther.mAllowSoftwareWebRenderD3D11 &&
|
||||
mAllowSoftwareWebRenderOGL == aOther.mAllowSoftwareWebRenderOGL &&
|
||||
mUseAdvancedLayers == aOther.mUseAdvancedLayers;
|
||||
mUseAdvancedLayers == aOther.mUseAdvancedLayers &&
|
||||
mUseWebGPU == aOther.mUseWebGPU;
|
||||
}
|
||||
|
||||
friend struct IPC::ParamTraits<CompositorOptions>;
|
||||
|
||||
private:
|
||||
bool mUseAPZ;
|
||||
bool mUseSoftwareWebRender;
|
||||
bool mAllowSoftwareWebRenderD3D11;
|
||||
bool mAllowSoftwareWebRenderOGL;
|
||||
bool mUseAdvancedLayers;
|
||||
bool mInitiallyPaused;
|
||||
bool mUseAPZ = false;
|
||||
bool mUseSoftwareWebRender = false;
|
||||
bool mAllowSoftwareWebRenderD3D11 = false;
|
||||
bool mAllowSoftwareWebRenderOGL = false;
|
||||
bool mUseAdvancedLayers = false;
|
||||
bool mUseWebGPU = false;
|
||||
bool mInitiallyPaused = false;
|
||||
|
||||
// Make sure to add new fields to the ParamTraits implementation
|
||||
// in LayersMessageUtils.h
|
||||
|
|
|
@ -1296,7 +1296,13 @@ bool CompositorBridgeParent::DeallocPWebRenderBridgeParent(
|
|||
}
|
||||
|
||||
webgpu::PWebGPUParent* CompositorBridgeParent::AllocPWebGPUParent() {
|
||||
// This should only ever get called in the GPU process.
|
||||
MOZ_ASSERT(XRE_IsGPUProcess());
|
||||
// Shouldn't re-initialize
|
||||
MOZ_ASSERT(!mWebGPUBridge);
|
||||
// We should only ever get this if WebGPU is enabled in this compositor.
|
||||
MOZ_RELEASE_ASSERT(mOptions.UseWebGPU());
|
||||
|
||||
mWebGPUBridge = new webgpu::WebGPUParent();
|
||||
mWebGPUBridge.get()->AddRef(); // IPDL reference
|
||||
return mWebGPUBridge;
|
||||
|
|
|
@ -1331,6 +1331,8 @@ already_AddRefed<WebRenderLayerManager> nsBaseWidget::CreateCompositorSession(
|
|||
}
|
||||
#endif
|
||||
|
||||
options.SetUseWebGPU(StaticPrefs::dom_webgpu_enabled());
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
if (!GetNativeData(NS_JAVA_SURFACE)) {
|
||||
options.SetInitiallyPaused(true);
|
||||
|
|
Загрузка…
Ссылка в новой задаче