Bug 1824696 - Initialize gfxGradientCache in GPU process only when remote canvas is enabled r=gfx-reviewers,lsalzman

On Android, remote canvas is disabled. gfxGradientCache does not need to be initialized.

Differential Revision: https://phabricator.services.mozilla.com/D174058
This commit is contained in:
sotaro
2023-03-31 04:08:40 +00:00
parent 8f6d13b1ce
commit 0908f3c800

View File

@@ -201,7 +201,6 @@ bool GPUParent::Init(mozilla::ipc::UntypedEndpoint&& aEndpoint,
apz::InitializeGlobalState(); apz::InitializeGlobalState();
LayerTreeOwnerTracker::Initialize(); LayerTreeOwnerTracker::Initialize();
CompositorBridgeParent::InitializeStatics(); CompositorBridgeParent::InitializeStatics();
gfxGradientCache::Init();
mozilla::ipc::SetThisProcessName("GPU Process"); mozilla::ipc::SetThisProcessName("GPU Process");
return true; return true;
@@ -286,6 +285,10 @@ mozilla::ipc::IPCResult GPUParent::RecvInit(
// here that would normally be initialized there. // here that would normally be initialized there.
SkGraphics::Init(); SkGraphics::Init();
if (gfxVars::RemoteCanvasEnabled()) {
gfxGradientCache::Init();
}
#if defined(XP_WIN) #if defined(XP_WIN)
if (gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) { if (gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) {
if (DeviceManagerDx::Get()->CreateCompositorDevices() && if (DeviceManagerDx::Get()->CreateCompositorDevices() &&