Bug 1316279 - Part 1: Fix gfxPrefs support for WebVR in out-of-process compositing; r?kip
MozReview-Commit-ID: 13tPgT0uDDi
--- a/gfx/ipc/GPUParent.cpp
+++ b/gfx/ipc/GPUParent.cpp
@@ -101,17 +101,16 @@ GPUParent::Init(base::ProcessId aParentP
if (NS_FAILED(NS_InitMinimalXPCOM())) {
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;
}
@@ -181,16 +180,17 @@ GPUParent::RecvInit(nsTArray<GfxPrefSett
};
char** argvp = argv;
gtk_init(&argc, &argvp);
} else {
gtk_init(nullptr, nullptr);
}
#endif
+ VRManager::ManagerInit();
// Send a message to the UI process that we're done.
GPUDeviceData data;
RecvGetDeviceStatus(&data);
Unused << SendInitComplete(data);
return IPC_OK();
}
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -411,16 +411,17 @@ private:
// These times should be in milliseconds
DECL_GFX_PREF(Once, "gfx.touch.resample.delay-threshold", TouchResampleVsyncDelayThreshold, int32_t, 20);
DECL_GFX_PREF(Once, "gfx.touch.resample.max-predict", TouchResampleMaxPredict, int32_t, 8);
DECL_GFX_PREF(Once, "gfx.touch.resample.min-delta", TouchResampleMinDelta, int32_t, 2);
DECL_GFX_PREF(Once, "gfx.touch.resample.old-touch-threshold",TouchResampleOldTouchThreshold, int32_t, 17);
DECL_GFX_PREF(Once, "gfx.touch.resample.vsync-adjust", TouchVsyncSampleAdjust, int32_t, 5);
+ DECL_GFX_PREF(Once, "gfx.vr.openvr-runtime", VROpenVRRuntime, std::string, "");
DECL_GFX_PREF(Live, "gfx.vsync.collect-scroll-transforms", CollectScrollTransforms, bool, false);
DECL_GFX_PREF(Once, "gfx.vsync.compositor.unobserve-count", CompositorUnobserveCount, int32_t, 10);
// Use vsync events generated by hardware
DECL_GFX_PREF(Once, "gfx.work-around-driver-bugs", WorkAroundDriverBugs, bool, true);
DECL_GFX_PREF(Once, "gfx.screen-mirroring.enabled", ScreenMirroringEnabled, bool, false);
DECL_GFX_PREF(Live, "gl.ignore-dx-interop2-blacklist", IgnoreDXInterop2Blacklist, bool, false);
DECL_GFX_PREF(Live, "gl.msaa-level", MSAALevel, uint32_t, 2);
--- a/gfx/vr/gfxVROpenVR.cpp
+++ b/gfx/vr/gfxVROpenVR.cpp
@@ -95,22 +95,22 @@ const uint32_t gOpenVRAxes[] = {
const uint32_t gNumOpenVRAxis = sizeof(gOpenVRAxes) /
sizeof(uint32_t);
bool
LoadOpenVRRuntime()
{
static PRLibrary *openvrLib = nullptr;
+ std::string openvrPath = gfxPrefs::VROpenVRRuntime();
- nsAdoptingCString openvrPath = Preferences::GetCString("gfx.vr.openvr-runtime");
- if (!openvrPath)
+ if (!openvrPath.c_str())
return false;
- openvrLib = PR_LoadLibrary(openvrPath.BeginReading());
+ openvrLib = PR_LoadLibrary(openvrPath.c_str());
if (!openvrLib)
return false;
#define REQUIRE_FUNCTION(_x) do { \
*(void **)&vr_##_x = (void *) PR_FindSymbol(openvrLib, "VR_" #_x); \
if (!vr_##_x) { printf_stderr("VR_" #_x " symbol missing\n"); return false; } \
} while (0)