2017-10-28 02:10:06 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2016-06-11 05:27:24 +03:00
|
|
|
/* 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/. */
|
|
|
|
#ifndef _include_gfx_ipc_GPUParent_h__
|
|
|
|
#define _include_gfx_ipc_GPUParent_h__
|
|
|
|
|
2016-07-19 21:56:06 +03:00
|
|
|
#include "mozilla/RefPtr.h"
|
2016-06-11 05:27:24 +03:00
|
|
|
#include "mozilla/gfx/PGPUParent.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
2017-01-03 23:13:36 +03:00
|
|
|
|
|
|
|
class TimeStamp;
|
2017-05-30 22:06:14 +03:00
|
|
|
class ChildProfilerController;
|
2017-01-03 23:13:36 +03:00
|
|
|
|
2016-06-11 05:27:24 +03:00
|
|
|
namespace gfx {
|
|
|
|
|
2016-07-19 21:56:06 +03:00
|
|
|
class VsyncBridgeParent;
|
|
|
|
|
2016-06-11 05:27:24 +03:00
|
|
|
class GPUParent final : public PGPUParent {
|
|
|
|
public:
|
|
|
|
GPUParent();
|
|
|
|
~GPUParent();
|
|
|
|
|
2016-09-22 08:38:44 +03:00
|
|
|
static GPUParent* GetSingleton();
|
|
|
|
|
2018-09-15 02:25:38 +03:00
|
|
|
// Gets the name of the GPU process, in the format expected by about:memory.
|
|
|
|
// There must be a GPU process active, and the caller must be either in that
|
|
|
|
// process or the parent process.
|
|
|
|
static void GetGPUProcessName(nsACString& aStr);
|
|
|
|
|
2016-06-11 05:27:24 +03:00
|
|
|
bool Init(base::ProcessId aParentPid, const char* aParentBuildID,
|
|
|
|
MessageLoop* aIOLoop, IPC::Channel* aChannel);
|
2016-11-06 22:01:52 +03:00
|
|
|
void NotifyDeviceReset();
|
2016-06-11 05:27:24 +03:00
|
|
|
|
2019-02-06 18:58:07 +03:00
|
|
|
PAPZInputBridgeParent* AllocPAPZInputBridgeParent(const LayersId& aLayersId);
|
|
|
|
bool DeallocPAPZInputBridgeParent(PAPZInputBridgeParent* aActor);
|
2018-03-16 23:28:19 +03:00
|
|
|
|
2019-02-06 18:58:43 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInit(nsTArray<GfxPrefSetting>&& prefs,
|
|
|
|
nsTArray<GfxVarUpdate>&& vars,
|
|
|
|
const DevicePrefs& devicePrefs,
|
|
|
|
nsTArray<LayerTreeIdMapping>&& mappings);
|
2017-06-14 18:39:59 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitCompositorManager(
|
2019-02-06 18:58:43 +03:00
|
|
|
Endpoint<PCompositorManagerParent>&& aEndpoint);
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitVsyncBridge(
|
2019-02-06 18:58:43 +03:00
|
|
|
Endpoint<PVsyncBridgeParent>&& aVsyncEndpoint);
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitImageBridge(
|
2019-02-06 18:58:43 +03:00
|
|
|
Endpoint<PImageBridgeParent>&& aEndpoint);
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitVRManager(
|
2019-02-06 18:58:43 +03:00
|
|
|
Endpoint<PVRManagerParent>&& aEndpoint);
|
|
|
|
mozilla::ipc::IPCResult RecvInitVR(Endpoint<PVRGPUChild>&& aVRGPUChild);
|
2018-03-25 02:06:01 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitUiCompositorController(
|
|
|
|
const LayersId& aRootLayerTreeId,
|
2019-02-06 18:58:43 +03:00
|
|
|
Endpoint<PUiCompositorControllerParent>&& aEndpoint);
|
2017-05-30 22:06:14 +03:00
|
|
|
mozilla::ipc::IPCResult RecvInitProfiler(
|
2019-02-06 18:58:43 +03:00
|
|
|
Endpoint<PProfilerChild>&& aEndpoint);
|
|
|
|
mozilla::ipc::IPCResult RecvUpdatePref(const GfxPrefSetting& pref);
|
|
|
|
mozilla::ipc::IPCResult RecvUpdateVar(const GfxVarUpdate& pref);
|
2017-06-14 18:39:59 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNewContentCompositorManager(
|
2019-02-06 18:58:43 +03:00
|
|
|
Endpoint<PCompositorManagerParent>&& aEndpoint);
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNewContentImageBridge(
|
2019-02-06 18:58:43 +03:00
|
|
|
Endpoint<PImageBridgeParent>&& aEndpoint);
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNewContentVRManager(
|
2019-02-06 18:58:43 +03:00
|
|
|
Endpoint<PVRManagerParent>&& aEndpoint);
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvNewContentVideoDecoderManager(
|
2019-02-06 18:58:43 +03:00
|
|
|
Endpoint<PVideoDecoderManagerParent>&& aEndpoint);
|
|
|
|
mozilla::ipc::IPCResult RecvGetDeviceStatus(GPUDeviceData* aOutStatus);
|
|
|
|
mozilla::ipc::IPCResult RecvSimulateDeviceReset(GPUDeviceData* aOutStatus);
|
2017-04-04 01:13:38 +03:00
|
|
|
mozilla::ipc::IPCResult RecvAddLayerTreeIdMapping(
|
2019-02-06 18:58:43 +03:00
|
|
|
const LayerTreeIdMapping& aMapping);
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRemoveLayerTreeIdMapping(
|
2019-02-06 18:58:43 +03:00
|
|
|
const LayerTreeIdMapping& aMapping);
|
|
|
|
mozilla::ipc::IPCResult RecvNotifyGpuObservers(const nsCString& aTopic);
|
2017-01-27 03:35:54 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRequestMemoryReport(
|
|
|
|
const uint32_t& generation, const bool& anonymize,
|
2019-02-06 18:58:43 +03:00
|
|
|
const bool& minimizeMemoryUsage, const MaybeFileDesc& DMDFile);
|
|
|
|
mozilla::ipc::IPCResult RecvShutdownVR();
|
2016-06-11 05:27:24 +03:00
|
|
|
|
|
|
|
void ActorDestroy(ActorDestroyReason aWhy) override;
|
2016-07-19 21:56:06 +03:00
|
|
|
|
|
|
|
private:
|
2017-01-03 23:13:36 +03:00
|
|
|
const TimeStamp mLaunchTime;
|
2016-07-19 21:56:06 +03:00
|
|
|
RefPtr<VsyncBridgeParent> mVsyncBridge;
|
2017-05-30 22:06:14 +03:00
|
|
|
#ifdef MOZ_GECKO_PROFILER
|
|
|
|
RefPtr<ChildProfilerController> mProfilerController;
|
|
|
|
#endif
|
2016-06-11 05:27:24 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace gfx
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // _include_gfx_ipc_GPUParent_h__
|