Bug 1288618 - Part 12: Initialize WMF in the GPU process. r?dvander
MozReview-Commit-ID: DlCg76mzun1
--- a/gfx/ipc/GPUParent.cpp
+++ b/gfx/ipc/GPUParent.cpp
@@ -1,13 +1,16 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=99: */
/* 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"
#include "gfxPrefs.h"
#include "GPUProcessHost.h"
#include "mozilla/Assertions.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/ipc/ProcessChild.h"
@@ -69,16 +72,19 @@ GPUParent::Init(base::ProcessId aParentP
return false;
}
CompositorThreadHolder::Start();
APZThreadUtils::SetControllerThread(CompositorThreadHolder::Loop());
APZCTreeManager::InitializeGlobalState();
VRManager::ManagerInit();
LayerTreeOwnerTracker::Initialize();
mozilla::ipc::SetThisProcessName("GPU Process");
+#ifdef XP_WIN
+ wmf::MFStartup();
+#endif
return true;
}
bool
GPUParent::RecvInit(nsTArray<GfxPrefSetting>&& prefs,
nsTArray<GfxVarUpdate>&& vars,
const DevicePrefs& devicePrefs)
{
@@ -268,16 +274,20 @@ GPUParent::RecvAddLayerTreeIdMapping(con
void
GPUParent::ActorDestroy(ActorDestroyReason aWhy)
{
if (AbnormalShutdown == aWhy) {
NS_WARNING("Shutting down GPU process early due to a crash!");
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.
ProcessChild::QuickExit();
#endif
if (mVsyncBridge) {
mVsyncBridge->Shutdown();
--- a/gfx/ipc/GPUProcessHost.cpp
+++ b/gfx/ipc/GPUProcessHost.cpp
@@ -8,16 +8,18 @@
#include "chrome/common/process_watcher.h"
#include "gfxPrefs.h"
#include "mozilla/gfx/Logging.h"
#include "nsITimer.h"
namespace mozilla {
namespace gfx {
+using namespace ipc;
+
GPUProcessHost::GPUProcessHost(Listener* aListener)
: GeckoChildProcessHost(GeckoProcessType_GPU),
mListener(aListener),
mTaskFactory(this),
mLaunchPhase(LaunchPhase::Unlaunched),
mProcessToken(0),
mShutdownRequested(false),
mChannelClosed(false)
--- a/gfx/ipc/moz.build
+++ b/gfx/ipc/moz.build
@@ -41,28 +41,31 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
'SharedDIBWin.cpp',
]
UNIFIED_SOURCES += [
'CompositorSession.cpp',
'CompositorWidgetVsyncObserver.cpp',
'D3DMessageUtils.cpp',
'GPUChild.cpp',
- 'GPUParent.cpp',
'GPUProcessHost.cpp',
'GPUProcessImpl.cpp',
'GPUProcessManager.cpp',
'InProcessCompositorSession.cpp',
'RemoteCompositorSession.cpp',
'SharedDIB.cpp',
'VsyncBridgeChild.cpp',
'VsyncBridgeParent.cpp',
'VsyncIOThreadHolder.cpp',
]
+SOURCES += [
+ 'GPUParent.cpp',
+]
+
IPDL_SOURCES = [
'GraphicsMessages.ipdlh',
'PGPU.ipdl',
'PVsyncBridge.ipdl',
]
LOCAL_INCLUDES += ['/dom/ipc']