From 1f7fd955fa46a1f2be9f7e1080fcfc70d2ea1ada Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Wed, 21 Sep 2016 15:36:10 +1200 Subject: [PATCH] Bug 1288618 - Part 12: Initialize WMF in the GPU process. r=dvander --HG-- extra : rebase_source : 12d1829522bd2761308e1b2bcaf488a1e5f15f67 --- gfx/ipc/GPUParent.cpp | 10 ++++++++++ gfx/ipc/GPUProcessHost.cpp | 2 ++ gfx/ipc/moz.build | 5 ++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gfx/ipc/GPUParent.cpp b/gfx/ipc/GPUParent.cpp index 0148f922d96e..8d7446a941e9 100644 --- a/gfx/ipc/GPUParent.cpp +++ b/gfx/ipc/GPUParent.cpp @@ -3,6 +3,9 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifdef XP_WIN +#include "WMF.h" +#endif #include "GPUParent.h" #include "gfxConfig.h" #include "gfxPlatform.h" @@ -74,6 +77,9 @@ GPUParent::Init(base::ProcessId aParentPid, VRManager::ManagerInit(); LayerTreeOwnerTracker::Initialize(); mozilla::ipc::SetThisProcessName("GPU Process"); +#ifdef XP_WIN + wmf::MFStartup(); +#endif return true; } @@ -273,6 +279,10 @@ GPUParent::ActorDestroy(ActorDestroyReason aWhy) ProcessChild::QuickExit(); } +#ifdef XP_WIN + wmf::MFShutdown(); +#endif + #ifndef NS_FREE_PERMANENT_DATA // No point in going through XPCOM shutdown because we don't keep persistent // state. diff --git a/gfx/ipc/GPUProcessHost.cpp b/gfx/ipc/GPUProcessHost.cpp index d1214a0e8f66..3e2b68611c62 100644 --- a/gfx/ipc/GPUProcessHost.cpp +++ b/gfx/ipc/GPUProcessHost.cpp @@ -13,6 +13,8 @@ namespace mozilla { namespace gfx { +using namespace ipc; + GPUProcessHost::GPUProcessHost(Listener* aListener) : GeckoChildProcessHost(GeckoProcessType_GPU), mListener(aListener), diff --git a/gfx/ipc/moz.build b/gfx/ipc/moz.build index 6bce9a48ac40..1abeed33c964 100644 --- a/gfx/ipc/moz.build +++ b/gfx/ipc/moz.build @@ -47,7 +47,6 @@ UNIFIED_SOURCES += [ 'CompositorWidgetVsyncObserver.cpp', 'D3DMessageUtils.cpp', 'GPUChild.cpp', - 'GPUParent.cpp', 'GPUProcessHost.cpp', 'GPUProcessImpl.cpp', 'GPUProcessManager.cpp', @@ -59,6 +58,10 @@ UNIFIED_SOURCES += [ 'VsyncIOThreadHolder.cpp', ] +SOURCES += [ + 'GPUParent.cpp', +] + IPDL_SOURCES = [ 'GraphicsMessages.ipdlh', 'PGPU.ipdl',