Backed out 2 changesets (bug 1350660) for causing merge conflicts a=backout

Backed out changeset 13d070200dfe (bug 1350660)
Backed out changeset f033452487fc (bug 1350660)
This commit is contained in:
Wes Kocher 2017-03-31 17:45:11 -07:00
parent 572d67e180
commit 5c91602e70
13 changed files with 24 additions and 97 deletions

View File

@ -18,7 +18,6 @@
# include "mozilla/gfx/DeviceManagerDx.h"
#endif
#include "mozilla/ipc/CrashReporterHost.h"
#include "mozilla/layers/LayerTreeOwnerTracker.h"
#include "mozilla/Unused.h"
#ifdef MOZ_GECKO_PROFILER
#include "CrossProcessProfilerController.h"
@ -27,8 +26,6 @@
namespace mozilla {
namespace gfx {
using namespace layers;
GPUChild::GPUChild(GPUProcessHost* aHost)
: mHost(aHost),
mGPUReady(false)
@ -68,12 +65,7 @@ GPUChild::Init()
devicePrefs.oglCompositing() = gfxConfig::GetValue(Feature::OPENGL_COMPOSITING);
devicePrefs.useD2D1() = gfxConfig::GetValue(Feature::DIRECT2D);
nsTArray<LayerTreeIdMapping> mappings;
LayerTreeOwnerTracker::Get()->Iterate([&](uint64_t aLayersId, base::ProcessId aProcessId) {
mappings.AppendElement(LayerTreeIdMapping(aLayersId, aProcessId));
});
SendInit(prefs, updates, devicePrefs, mappings);
SendInit(prefs, updates, devicePrefs);
gfxVars::AddReceiver(this);

View File

@ -147,8 +147,7 @@ GPUParent::NotifyDeviceReset()
mozilla::ipc::IPCResult
GPUParent::RecvInit(nsTArray<GfxPrefSetting>&& prefs,
nsTArray<GfxVarUpdate>&& vars,
const DevicePrefs& devicePrefs,
nsTArray<LayerTreeIdMapping>&& aMappings)
const DevicePrefs& devicePrefs)
{
const nsTArray<gfxPrefs::Pref*>& globalPrefs = gfxPrefs::all();
for (auto& setting : prefs) {
@ -165,10 +164,6 @@ GPUParent::RecvInit(nsTArray<GfxPrefSetting>&& prefs,
gfxConfig::Inherit(Feature::OPENGL_COMPOSITING, devicePrefs.oglCompositing());
gfxConfig::Inherit(Feature::DIRECT2D, devicePrefs.useD2D1());
for (const LayerTreeIdMapping& map : aMappings) {
LayerTreeOwnerTracker::Get()->Map(map.layersId(), map.ownerId());
}
#if defined(XP_WIN)
if (gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) {
DeviceManagerDx::Get()->CreateCompositorDevices();
@ -355,9 +350,11 @@ GPUParent::RecvNewContentVideoDecoderManager(Endpoint<PVideoDecoderManagerParent
}
mozilla::ipc::IPCResult
GPUParent::RecvAddLayerTreeIdMapping(const LayerTreeIdMapping& aMapping)
GPUParent::RecvAddLayerTreeIdMapping(nsTArray<LayerTreeIdMapping>&& aMappings)
{
LayerTreeOwnerTracker::Get()->Map(aMapping.layersId(), aMapping.ownerId());
for (const LayerTreeIdMapping& map : aMappings) {
LayerTreeOwnerTracker::Get()->Map(map.layersId(), map.ownerId());
}
return IPC_OK();
}

View File

@ -32,8 +32,7 @@ public:
mozilla::ipc::IPCResult RecvInit(nsTArray<GfxPrefSetting>&& prefs,
nsTArray<GfxVarUpdate>&& vars,
const DevicePrefs& devicePrefs,
nsTArray<LayerTreeIdMapping>&& mappings) override;
const DevicePrefs& devicePrefs) override;
mozilla::ipc::IPCResult RecvInitVsyncBridge(Endpoint<PVsyncBridgeParent>&& aVsyncEndpoint) override;
mozilla::ipc::IPCResult RecvInitImageBridge(Endpoint<PImageBridgeParent>&& aEndpoint) override;
mozilla::ipc::IPCResult RecvInitVRManager(Endpoint<PVRManagerParent>&& aEndpoint) override;
@ -52,7 +51,7 @@ public:
mozilla::ipc::IPCResult RecvNewContentVRManager(Endpoint<PVRManagerParent>&& aEndpoint) override;
mozilla::ipc::IPCResult RecvNewContentVideoDecoderManager(Endpoint<PVideoDecoderManagerParent>&& aEndpoint) override;
mozilla::ipc::IPCResult RecvGetDeviceStatus(GPUDeviceData* aOutStatus) override;
mozilla::ipc::IPCResult RecvAddLayerTreeIdMapping(const LayerTreeIdMapping& aMapping) override;
mozilla::ipc::IPCResult RecvAddLayerTreeIdMapping(nsTArray<LayerTreeIdMapping>&& aMappings) override;
mozilla::ipc::IPCResult RecvRemoveLayerTreeIdMapping(const LayerTreeIdMapping& aMapping) override;
mozilla::ipc::IPCResult RecvNotifyGpuObservers(const nsCString& aTopic) override;
mozilla::ipc::IPCResult RecvStartProfiler(const ProfilerInitParams& params) override;

View File

@ -301,6 +301,12 @@ GPUProcessManager::OnProcessLaunchComplete(GPUProcessHost* aHost)
mVsyncBridge = VsyncBridgeChild::Create(mVsyncIOThread, mProcessToken, Move(vsyncChild));
mGPUChild->SendInitVsyncBridge(Move(vsyncParent));
nsTArray<LayerTreeIdMapping> mappings;
LayerTreeOwnerTracker::Get()->Iterate([&](uint64_t aLayersId, base::ProcessId aProcessId) {
mappings.AppendElement(LayerTreeIdMapping(aLayersId, aProcessId));
});
mGPUChild->SendAddLayerTreeIdMapping(mappings);
}
static bool
@ -816,7 +822,9 @@ GPUProcessManager::MapLayerTreeId(uint64_t aLayersId, base::ProcessId aOwningId)
LayerTreeOwnerTracker::Get()->Map(aLayersId, aOwningId);
if (EnsureGPUReady()) {
mGPUChild->SendAddLayerTreeIdMapping(LayerTreeIdMapping(aLayersId, aOwningId));
AutoTArray<LayerTreeIdMapping, 1> mappings;
mappings.AppendElement(LayerTreeIdMapping(aLayersId, aOwningId));
mGPUChild->SendAddLayerTreeIdMapping(mappings);
}
}
@ -845,30 +853,6 @@ GPUProcessManager::AllocateLayerTreeId()
return ++mNextLayerTreeId;
}
uint64_t
GPUProcessManager::AllocateAndConnectLayerTreeId(PCompositorBridgeChild* aCompositorBridge,
base::ProcessId aOtherPid)
{
uint64_t layersId = AllocateLayerTreeId();
if (!mGPUChild || !aCompositorBridge) {
// If we're not remoting to another process, or there is no compositor,
// then we'll send at most one message. In this case we can just keep
// the old behavior of making sure the mapping occurs, and maybe sending
// a creation notification.
MapLayerTreeId(layersId, aOtherPid);
if (aCompositorBridge) {
aCompositorBridge->SendNotifyChildCreated(layersId);
}
return layersId;
}
// Use the combined message path.
LayerTreeOwnerTracker::Get()->Map(layersId, aOtherPid);
aCompositorBridge->SendMapAndNotifyChildCreated(layersId, aOtherPid);
return layersId;
}
void
GPUProcessManager::EnsureVsyncIOThread()
{

View File

@ -116,15 +116,9 @@ public:
// Allocate an ID that can be used to refer to a layer tree and
// associated resources that live only on the compositor thread.
//
// Must run on the browser main thread.
// Must run on the content main thread.
uint64_t AllocateLayerTreeId();
// Allocate a layers ID and connect it to a compositor. If the compositor is null,
// the connect operation will not be performed, but an ID will still be allocated.
// This must be called from the browser main thread.
uint64_t AllocateAndConnectLayerTreeId(
PCompositorBridgeChild* aCompositorBridge,
base::ProcessId aOtherPid);
void OnProcessLaunchComplete(GPUProcessHost* aHost) override;
void OnProcessUnexpectedShutdown(GPUProcessHost* aHost) override;

View File

@ -52,8 +52,7 @@ parent:
// Sent by the UI process to initiate core settings.
async Init(GfxPrefSetting[] prefs,
GfxVarUpdate[] vars,
DevicePrefs devicePrefs,
LayerTreeIdMapping[] mapping);
DevicePrefs devicePrefs);
async InitVsyncBridge(Endpoint<PVsyncBridgeParent> endpoint);
async InitImageBridge(Endpoint<PImageBridgeParent> endpoint);
@ -79,7 +78,7 @@ parent:
async NewContentVideoDecoderManager(Endpoint<PVideoDecoderManagerParent> endpoint);
// Called to notify the GPU process of who owns a layersId.
sync AddLayerTreeIdMapping(LayerTreeIdMapping mapping);
sync AddLayerTreeIdMapping(LayerTreeIdMapping[] mapping);
async RemoveLayerTreeIdMapping(LayerTreeIdMapping mapping);
// Request the current DeviceStatus from the GPU process. This blocks until

View File

@ -1554,20 +1554,6 @@ CompositorBridgeParent::NotifyChildCreated(uint64_t aChild)
sIndirectLayerTrees[aChild].mLayerManager = mLayerManager;
}
mozilla::ipc::IPCResult
CompositorBridgeParent::RecvMapAndNotifyChildCreated(const uint64_t& aChild, const base::ProcessId& aOwnerPid)
{
// We only use this message when the remote compositor is in the GPU process.
// It is harmless to call it, though.
MOZ_ASSERT(XRE_IsGPUProcess());
LayerTreeOwnerTracker::Get()->Map(aChild, aOwnerPid);
MonitorAutoLock lock(*sIndirectLayerTreesLock);
NotifyChildCreated(aChild);
return IPC_OK();
}
mozilla::ipc::IPCResult
CompositorBridgeParent::RecvAdoptChild(const uint64_t& child)
{

View File

@ -189,7 +189,6 @@ public:
virtual mozilla::ipc::IPCResult RecvPause() override;
virtual mozilla::ipc::IPCResult RecvResume() override;
virtual mozilla::ipc::IPCResult RecvNotifyChildCreated(const uint64_t& child) override;
virtual mozilla::ipc::IPCResult RecvMapAndNotifyChildCreated(const uint64_t& child, const base::ProcessId& pid) override;
virtual mozilla::ipc::IPCResult RecvNotifyChildRecreated(const uint64_t& child) override;
virtual mozilla::ipc::IPCResult RecvAdoptChild(const uint64_t& child) override;
virtual mozilla::ipc::IPCResult RecvMakeSnapshot(const SurfaceDescriptor& aInSnapshot,

View File

@ -264,14 +264,6 @@ CrossProcessCompositorBridgeParent::RecvNotifyChildCreated(const uint64_t& child
return IPC_FAIL_NO_REASON(this);
}
mozilla::ipc::IPCResult
CrossProcessCompositorBridgeParent::RecvMapAndNotifyChildCreated(const uint64_t& child, const base::ProcessId& pid)
{
// This can only be called from the browser process, as the mapping
// ensures proper window ownership of layer trees.
return IPC_FAIL_NO_REASON(this);
}
void
CrossProcessCompositorBridgeParent::ShadowLayersUpdated(
LayerTransactionParent* aLayerTree,

View File

@ -56,7 +56,6 @@ public:
virtual mozilla::ipc::IPCResult RecvResume() override { return IPC_OK(); }
virtual mozilla::ipc::IPCResult RecvForceIsFirstPaint() override { return IPC_OK(); }
virtual mozilla::ipc::IPCResult RecvNotifyChildCreated(const uint64_t& child) override;
virtual mozilla::ipc::IPCResult RecvMapAndNotifyChildCreated(const uint64_t& child, const base::ProcessId& pid) override;
virtual mozilla::ipc::IPCResult RecvNotifyChildRecreated(const uint64_t& child) override { return IPC_FAIL_NO_REASON(this); }
virtual mozilla::ipc::IPCResult RecvAdoptChild(const uint64_t& child) override { return IPC_FAIL_NO_REASON(this); }
virtual mozilla::ipc::IPCResult RecvMakeSnapshot(const SurfaceDescriptor& aInSnapshot,

View File

@ -36,7 +36,6 @@ using class mozilla::layers::FrameUniformityData from "mozilla/layers/FrameUnifo
using mozilla::layers::TextureFlags from "mozilla/layers/CompositorTypes.h";
using mozilla::layers::CompositorOptions from "mozilla/layers/CompositorOptions.h";
using mozilla::wr::PipelineId from "mozilla/webrender/WebRenderTypes.h";
using base::ProcessId from "base/process.h";
namespace mozilla {
namespace layers {
@ -176,12 +175,6 @@ parent:
// there are ordering issues with SendPLayerTransactionConstructor.
sync NotifyChildCreated(uint64_t id);
// This version of NotifyChildCreated also performs a layer tree mapping.
//
// See bug 1316632 comment #33 for why this has to be sync. Otherwise,
// there are ordering issues with SendPLayerTransactionConstructor.
sync MapAndNotifyChildCreated(uint64_t id, ProcessId owner);
async AdoptChild(uint64_t id);
// Same as NotifyChildCreated, but used when child processes need to

View File

@ -992,8 +992,6 @@ description =
description =
[PCompositorBridge::NotifyChildCreated]
description =
[PCompositorBridge::MapAndNotifyChildCreated]
description = bug 1350660
[PCompositorBridge::NotifyChildRecreated]
description =
[PCompositorBridge::MakeSnapshot]

View File

@ -114,17 +114,12 @@ RenderFrameParent::Init(nsFrameLoader* aFrameLoader)
TabParent* browser = TabParent::GetFrom(mFrameLoader);
if (XRE_IsParentProcess()) {
PCompositorBridgeChild* compositor = nullptr;
if (lm) {
compositor = lm->GetCompositorBridgeChild();
}
// Our remote frame will push layers updates to the compositor,
// and we'll keep an indirect reference to that tree.
GPUProcessManager* gpm = GPUProcessManager::Get();
mLayersId = gpm->AllocateAndConnectLayerTreeId(
compositor,
browser->Manager()->AsContentParent()->OtherPid());
browser->Manager()->AsContentParent()->AllocateLayerTreeId(browser, &mLayersId);
if (lm && lm->GetCompositorBridgeChild()) {
lm->GetCompositorBridgeChild()->SendNotifyChildCreated(mLayersId);
}
} else if (XRE_IsContentProcess()) {
ContentChild::GetSingleton()->SendAllocateLayerTreeId(browser->Manager()->ChildID(), browser->GetTabId(), &mLayersId);
CompositorBridgeChild::Get()->SendNotifyChildCreated(mLayersId);