Bug 1550422 - P22. Remove gfxPref sync with GPU process. r=mattwoodrow

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jean-Yves Avenard 2019-05-24 11:37:34 +00:00
Родитель 3e3e986f19
Коммит 50f48b12ca
5 изменённых файлов: 6 добавлений и 46 удалений

Просмотреть файл

@ -5,7 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "GPUChild.h"
#include "gfxConfig.h"
#include "gfxPrefs.h"
#include "GPUProcessHost.h"
#include "GPUProcessManager.h"
#include "VRProcessManager.h"
@ -41,22 +40,6 @@ GPUChild::GPUChild(GPUProcessHost* aHost) : mHost(aHost), mGPUReady(false) {
GPUChild::~GPUChild() { MOZ_COUNT_DTOR(GPUChild); }
void GPUChild::Init() {
// Build a list of prefs the GPU process will need. Note that because we
// limit the GPU 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.
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;
@ -74,7 +57,7 @@ void GPUChild::Init() {
mappings.AppendElement(LayerTreeIdMapping(aLayersId, aProcessId));
});
SendInit(prefs, updates, devicePrefs, mappings);
SendInit(updates, devicePrefs, mappings);
gfxVars::AddReceiver(this);

Просмотреть файл

@ -175,13 +175,8 @@ bool GPUParent::DeallocPAPZInputBridgeParent(PAPZInputBridgeParent* aActor) {
}
mozilla::ipc::IPCResult GPUParent::RecvInit(
nsTArray<GfxPrefSetting>&& prefs, nsTArray<GfxVarUpdate>&& vars,
const DevicePrefs& devicePrefs, nsTArray<LayerTreeIdMapping>&& aMappings) {
const nsTArray<gfxPrefs::Pref*>& globalPrefs = gfxPrefs::all();
for (auto& setting : prefs) {
gfxPrefs::Pref* pref = globalPrefs[setting.index()];
pref->SetCachedValue(setting.value());
}
nsTArray<GfxVarUpdate>&& vars, const DevicePrefs& devicePrefs,
nsTArray<LayerTreeIdMapping>&& aMappings) {
for (const auto& var : vars) {
gfxVars::ApplyUpdate(var);
}
@ -331,13 +326,6 @@ mozilla::ipc::IPCResult GPUParent::RecvInitProfiler(
return IPC_OK();
}
mozilla::ipc::IPCResult GPUParent::RecvUpdatePref(
const GfxPrefSetting& setting) {
gfxPrefs::Pref* pref = gfxPrefs::all()[setting.index()];
pref->SetCachedValue(setting.value());
return IPC_OK();
}
mozilla::ipc::IPCResult GPUParent::RecvUpdateVar(const GfxVarUpdate& aUpdate) {
gfxVars::ApplyUpdate(aUpdate);
return IPC_OK();

Просмотреть файл

@ -37,8 +37,7 @@ class GPUParent final : public PGPUParent {
PAPZInputBridgeParent* AllocPAPZInputBridgeParent(const LayersId& aLayersId);
bool DeallocPAPZInputBridgeParent(PAPZInputBridgeParent* aActor);
mozilla::ipc::IPCResult RecvInit(nsTArray<GfxPrefSetting>&& prefs,
nsTArray<GfxVarUpdate>&& vars,
mozilla::ipc::IPCResult RecvInit(nsTArray<GfxVarUpdate>&& vars,
const DevicePrefs& devicePrefs,
nsTArray<LayerTreeIdMapping>&& mappings);
mozilla::ipc::IPCResult RecvInitCompositorManager(
@ -55,7 +54,6 @@ class GPUParent final : public PGPUParent {
Endpoint<PUiCompositorControllerParent>&& aEndpoint);
mozilla::ipc::IPCResult RecvInitProfiler(
Endpoint<PProfilerChild>&& aEndpoint);
mozilla::ipc::IPCResult RecvUpdatePref(const GfxPrefSetting& pref);
mozilla::ipc::IPCResult RecvUpdateVar(const GfxVarUpdate& pref);
mozilla::ipc::IPCResult RecvPreferenceUpdate(const Pref& pref);
mozilla::ipc::IPCResult RecvNewContentCompositorManager(

Просмотреть файл

@ -50,8 +50,7 @@ parent:
async PAPZInputBridge(LayersId aLayersId);
// Sent by the UI process to initiate core settings.
async Init(GfxPrefSetting[] prefs,
GfxVarUpdate[] vars,
async Init(GfxVarUpdate[] vars,
DevicePrefs devicePrefs,
LayerTreeIdMapping[] mapping);
@ -63,8 +62,7 @@ parent:
async InitProfiler(Endpoint<PProfilerChild> endpoint);
// Forward GPU process its endpoints to the VR process.
async InitVR(Endpoint<PVRGPUChild> endpoint);
// Called to update a gfx preference or variable.
async UpdatePref(GfxPrefSetting pref);
// Called to update a gfx variable.
async UpdateVar(GfxVarUpdate var);
async PreferenceUpdate(Pref pref);

Просмотреть файл

@ -67,13 +67,6 @@ void gfxPrefs::AssertMainThread() {
}
void gfxPrefs::Pref::OnChange() {
if (auto gpm = gfx::GPUProcessManager::Get()) {
if (gfx::GPUChild* gpu = gpm->GetGPUChild()) {
GfxPrefValue value;
GetLiveValue(&value);
Unused << gpu->SendUpdatePref(gfx::GfxPrefSetting(mIndex, value));
}
}
FireChangeCallback();
}