Bug 1550422 - P21. Remove gfxPref sync with VR process. r=daoshengmu

Differential Revision: https://phabricator.services.mozilla.com/D31466

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jean-Yves Avenard 2019-05-22 12:46:21 +00:00
parent 518af372f9
commit 642b9705d8
5 changed files with 4 additions and 43 deletions

View File

@ -74,13 +74,6 @@ void gfxPrefs::Pref::OnChange() {
Unused << gpu->SendUpdatePref(gfx::GfxPrefSetting(mIndex, value));
}
}
if (auto vpm = gfx::VRProcessManager::Get()) {
if (gfx::VRChild* vr = vpm->GetVRChild()) {
GfxPrefValue value;
GetLiveValue(&value);
Unused << vr->SendUpdatePref(gfx::GfxPrefSetting(mIndex, value));
}
}
FireChangeCallback();
}

View File

@ -22,10 +22,9 @@ async protocol PVR
{
parent:
async NewGPUVRManager(Endpoint<PVRGPUParent> endpoint);
async Init(GfxPrefSetting[] prefs, GfxVarUpdate[] vars, DevicePrefs devicePrefs);
async Init(GfxVarUpdate[] vars, DevicePrefs devicePrefs);
async NotifyVsync(TimeStamp vsyncTimestamp);
async UpdatePref(GfxPrefSetting pref);
async UpdateVar(GfxVarUpdate var);
async PreferenceUpdate(Pref pref);
async OpenVRControllerActionPathToVR(nsCString aPath);

View File

@ -105,23 +105,6 @@ void VRChild::ActorDestroy(ActorDestroyReason aWhy) {
}
void VRChild::Init() {
// Build a list of prefs the VR process will need. Note that because we
// limit the VR process to prefs contained in gfxPrefs, we can simplify
// the message in two ways: one, we only need to send its index in gfxPrefs
// rather than its name, and two, we only need to send prefs that don't
// have their default value.
// Todo: Consider to make our own vrPrefs that we are interested in VR
// process.
nsTArray<GfxPrefSetting> prefs;
for (auto pref : gfxPrefs::all()) {
if (pref->HasDefaultValue()) {
continue;
}
GfxPrefValue value;
pref->GetCachedValue(&value);
prefs.AppendElement(GfxPrefSetting(pref->Index(), value));
}
nsTArray<GfxVarUpdate> updates = gfxVars::FetchNonDefaultVars();
DevicePrefs devicePrefs;
@ -133,7 +116,7 @@ void VRChild::Init() {
devicePrefs.advancedLayers() = gfxConfig::GetValue(Feature::ADVANCED_LAYERS);
devicePrefs.useD2D1() = gfxConfig::GetValue(Feature::DIRECT2D);
SendInit(prefs, updates, devicePrefs);
SendInit(updates, devicePrefs);
if (!sOpenVRControllerManifestManager) {
sOpenVRControllerManifestManager = new OpenVRControllerManifestManager();

View File

@ -38,16 +38,10 @@ IPCResult VRParent::RecvNewGPUVRManager(Endpoint<PVRGPUParent>&& aEndpoint) {
return IPC_OK();
}
IPCResult VRParent::RecvInit(nsTArray<GfxPrefSetting>&& prefs,
nsTArray<GfxVarUpdate>&& vars,
IPCResult VRParent::RecvInit(nsTArray<GfxVarUpdate>&& vars,
const DevicePrefs& devicePrefs) {
Unused << SendInitComplete();
const nsTArray<gfxPrefs::Pref*>& globalPrefs = gfxPrefs::all();
for (auto& setting : prefs) {
gfxPrefs::Pref* pref = globalPrefs[setting.index()];
pref->SetCachedValue(setting.value());
}
for (const auto& var : vars) {
gfxVars::ApplyUpdate(var);
}
@ -74,12 +68,6 @@ IPCResult VRParent::RecvNotifyVsync(const TimeStamp& vsyncTimestamp) {
return IPC_OK();
}
IPCResult VRParent::RecvUpdatePref(const GfxPrefSetting& setting) {
gfxPrefs::Pref* pref = gfxPrefs::all()[setting.index()];
pref->SetCachedValue(setting.value());
return IPC_OK();
}
IPCResult VRParent::RecvUpdateVar(const GfxVarUpdate& aUpdate) {
gfxVars::ApplyUpdate(aUpdate);
return IPC_OK();

View File

@ -36,11 +36,9 @@ class VRParent final : public PVRParent {
mozilla::ipc::IPCResult RecvNewGPUVRManager(
Endpoint<PVRGPUParent>&& aEndpoint);
mozilla::ipc::IPCResult RecvInit(nsTArray<GfxPrefSetting>&& prefs,
nsTArray<GfxVarUpdate>&& vars,
mozilla::ipc::IPCResult RecvInit(nsTArray<GfxVarUpdate>&& vars,
const DevicePrefs& devicePrefs);
mozilla::ipc::IPCResult RecvNotifyVsync(const TimeStamp& vsyncTimestamp);
mozilla::ipc::IPCResult RecvUpdatePref(const GfxPrefSetting& setting);
mozilla::ipc::IPCResult RecvUpdateVar(const GfxVarUpdate& pref);
mozilla::ipc::IPCResult RecvPreferenceUpdate(const Pref& pref);
mozilla::ipc::IPCResult RecvOpenVRControllerActionPathToVR(