2016-06-11 05:27:24 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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/. */
|
|
|
|
|
2016-08-04 21:33:42 +03:00
|
|
|
include GraphicsMessages;
|
2017-03-22 02:39:13 +03:00
|
|
|
include ProfilerTypes;
|
2017-01-27 03:35:54 +03:00
|
|
|
include MemoryReportTypes;
|
2016-07-18 07:24:28 +03:00
|
|
|
include protocol PCompositorBridge;
|
2016-07-20 10:19:27 +03:00
|
|
|
include protocol PImageBridge;
|
2016-07-21 10:14:59 +03:00
|
|
|
include protocol PVRManager;
|
2016-07-19 21:56:06 +03:00
|
|
|
include protocol PVsyncBridge;
|
2017-01-05 22:04:38 +03:00
|
|
|
include protocol PUiCompositorController;
|
2016-09-21 12:25:33 +03:00
|
|
|
include protocol PVideoDecoderManager;
|
2016-07-18 07:24:28 +03:00
|
|
|
|
2016-08-16 23:59:13 +03:00
|
|
|
using base::ProcessId from "base/process.h";
|
2016-07-26 11:57:11 +03:00
|
|
|
using mozilla::TimeDuration from "mozilla/TimeStamp.h";
|
2016-07-18 07:24:28 +03:00
|
|
|
using mozilla::CSSToLayoutDeviceScale from "Units.h";
|
2017-02-16 01:44:29 +03:00
|
|
|
using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h";
|
2016-07-18 07:24:28 +03:00
|
|
|
using mozilla::gfx::IntSize from "mozilla/gfx/2D.h";
|
2017-01-13 01:29:41 +03:00
|
|
|
using mozilla::layers::CompositorOptions from "mozilla/layers/CompositorOptions.h";
|
2016-10-31 08:35:57 +03:00
|
|
|
using mozilla::Telemetry::Accumulation from "mozilla/TelemetryComms.h";
|
|
|
|
using mozilla::Telemetry::KeyedAccumulation from "mozilla/TelemetryComms.h";
|
2017-01-16 07:12:00 +03:00
|
|
|
using mozilla::Telemetry::ScalarAction from "mozilla/TelemetryComms.h";
|
|
|
|
using mozilla::Telemetry::KeyedScalarAction from "mozilla/TelemetryComms.h";
|
2017-02-14 16:43:51 +03:00
|
|
|
using mozilla::Telemetry::ChildEventData from "mozilla/TelemetryComms.h";
|
2016-06-27 09:33:20 +03:00
|
|
|
|
2016-06-11 05:27:24 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace gfx {
|
|
|
|
|
2016-06-27 09:33:20 +03:00
|
|
|
union GfxPrefValue {
|
|
|
|
bool;
|
|
|
|
int32_t;
|
|
|
|
uint32_t;
|
|
|
|
float;
|
2016-11-23 04:38:02 +03:00
|
|
|
nsCString;
|
2016-06-27 09:33:20 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct GfxPrefSetting {
|
|
|
|
int32_t index;
|
|
|
|
GfxPrefValue value;
|
|
|
|
};
|
|
|
|
|
2016-11-02 23:55:07 +03:00
|
|
|
struct LayerTreeIdMapping {
|
|
|
|
uint64_t layersId;
|
|
|
|
ProcessId ownerId;
|
|
|
|
};
|
|
|
|
|
2016-06-11 05:27:24 +03:00
|
|
|
sync protocol PGPU
|
|
|
|
{
|
|
|
|
parent:
|
2016-06-27 09:33:20 +03:00
|
|
|
// Sent by the UI process to initiate core settings.
|
2016-08-21 06:59:10 +03:00
|
|
|
async Init(GfxPrefSetting[] prefs,
|
|
|
|
GfxVarUpdate[] vars,
|
2017-04-04 01:13:38 +03:00
|
|
|
DevicePrefs devicePrefs,
|
|
|
|
LayerTreeIdMapping[] mapping);
|
2016-06-27 09:33:20 +03:00
|
|
|
|
2016-07-20 10:19:27 +03:00
|
|
|
async InitVsyncBridge(Endpoint<PVsyncBridgeParent> endpoint);
|
|
|
|
async InitImageBridge(Endpoint<PImageBridgeParent> endpoint);
|
2016-07-21 10:14:59 +03:00
|
|
|
async InitVRManager(Endpoint<PVRManagerParent> endpoint);
|
2017-01-05 22:04:38 +03:00
|
|
|
async InitUiCompositorController(Endpoint<PUiCompositorControllerParent> endpoint);
|
2016-07-19 21:56:06 +03:00
|
|
|
|
2016-08-04 21:33:42 +03:00
|
|
|
// Called to update a gfx preference or variable.
|
2016-06-27 09:33:20 +03:00
|
|
|
async UpdatePref(GfxPrefSetting pref);
|
2016-08-04 21:33:42 +03:00
|
|
|
async UpdateVar(GfxVarUpdate var);
|
2016-07-18 07:24:28 +03:00
|
|
|
|
|
|
|
// Create a new top-level compositor.
|
|
|
|
async NewWidgetCompositor(Endpoint<PCompositorBridgeParent> endpoint,
|
|
|
|
CSSToLayoutDeviceScale scale,
|
2016-07-26 11:57:11 +03:00
|
|
|
TimeDuration vsyncRate,
|
2017-01-13 01:29:41 +03:00
|
|
|
CompositorOptions options,
|
2016-07-18 07:24:28 +03:00
|
|
|
bool useExternalSurface,
|
|
|
|
IntSize surfaceSize);
|
2016-07-18 07:24:28 +03:00
|
|
|
|
|
|
|
// Create a new content-process compositor bridge.
|
|
|
|
async NewContentCompositorBridge(Endpoint<PCompositorBridgeParent> endpoint);
|
2016-07-20 10:19:27 +03:00
|
|
|
async NewContentImageBridge(Endpoint<PImageBridgeParent> endpoint);
|
2016-07-21 10:14:59 +03:00
|
|
|
async NewContentVRManager(Endpoint<PVRManagerParent> endpoint);
|
2016-09-21 12:25:33 +03:00
|
|
|
async NewContentVideoDecoderManager(Endpoint<PVideoDecoderManagerParent> endpoint);
|
2016-08-17 19:11:00 +03:00
|
|
|
|
2016-08-16 23:59:13 +03:00
|
|
|
// Called to notify the GPU process of who owns a layersId.
|
2017-04-04 01:13:38 +03:00
|
|
|
sync AddLayerTreeIdMapping(LayerTreeIdMapping mapping);
|
2016-11-02 23:55:07 +03:00
|
|
|
async RemoveLayerTreeIdMapping(LayerTreeIdMapping mapping);
|
2016-08-16 23:59:13 +03:00
|
|
|
|
2016-08-21 06:59:11 +03:00
|
|
|
// Request the current DeviceStatus from the GPU process. This blocks until
|
|
|
|
// one is available (i.e., Init has completed).
|
|
|
|
sync GetDeviceStatus() returns (GPUDeviceData status);
|
|
|
|
|
2016-10-15 15:45:02 +03:00
|
|
|
// Have a message be broadcasted to the GPU process by the GPU process
|
|
|
|
// observer service.
|
|
|
|
async NotifyGpuObservers(nsCString aTopic);
|
|
|
|
|
2017-03-22 02:39:13 +03:00
|
|
|
// Control the Gecko Profiler in the GPU process.
|
|
|
|
async StartProfiler(ProfilerInitParams params);
|
|
|
|
async StopProfiler();
|
|
|
|
async PauseProfiler(bool aPause);
|
|
|
|
async GatherProfile();
|
|
|
|
|
2017-01-27 03:35:54 +03:00
|
|
|
async RequestMemoryReport(uint32_t generation,
|
|
|
|
bool anonymize,
|
|
|
|
bool minimizeMemoryUsage,
|
|
|
|
MaybeFileDesc DMDFile);
|
|
|
|
|
2016-08-21 06:59:11 +03:00
|
|
|
child:
|
|
|
|
// Sent when the GPU process has initialized devices. This occurs once, after
|
|
|
|
// Init().
|
|
|
|
async InitComplete(GPUDeviceData data);
|
2016-09-22 08:38:44 +03:00
|
|
|
|
|
|
|
// Sent when APZ detects checkerboarding and apz checkerboard reporting is enabled.
|
|
|
|
async ReportCheckerboard(uint32_t severity, nsCString log);
|
2016-10-01 00:31:06 +03:00
|
|
|
|
|
|
|
// Graphics errors, analogous to PContent::GraphicsError
|
|
|
|
async GraphicsError(nsCString aError);
|
2016-10-12 00:25:41 +03:00
|
|
|
|
2017-02-16 01:44:29 +03:00
|
|
|
async InitCrashReporter(Shmem shmem, NativeThreadId threadId);
|
2016-10-15 15:45:02 +03:00
|
|
|
|
|
|
|
// Have a message be broadcasted to the UI process by the UI process
|
|
|
|
// observer service.
|
|
|
|
async NotifyUiObservers(nsCString aTopic);
|
2016-10-31 08:35:57 +03:00
|
|
|
|
|
|
|
// Messages for reporting telemetry to the UI process.
|
2017-02-15 18:25:40 +03:00
|
|
|
async AccumulateChildHistograms(Accumulation[] accumulations);
|
|
|
|
async AccumulateChildKeyedHistograms(KeyedAccumulation[] accumulations);
|
2017-01-16 07:12:00 +03:00
|
|
|
async UpdateChildScalars(ScalarAction[] actions);
|
|
|
|
async UpdateChildKeyedScalars(KeyedScalarAction[] actions);
|
2017-02-14 16:43:51 +03:00
|
|
|
async RecordChildEvents(ChildEventData[] events);
|
2016-11-06 22:01:52 +03:00
|
|
|
|
2017-04-05 10:17:36 +03:00
|
|
|
async NotifyDeviceReset(GPUDeviceData status);
|
2017-01-27 03:35:54 +03:00
|
|
|
|
2017-03-22 02:39:13 +03:00
|
|
|
// Called in response to GatherProfile.
|
2017-04-12 23:44:31 +03:00
|
|
|
async Profile(nsCString aProfile, bool aIsExitProfile);
|
2017-01-27 03:35:54 +03:00
|
|
|
async AddMemoryReport(MemoryReport aReport);
|
|
|
|
async FinishMemoryReport(uint32_t aGeneration);
|
2016-06-11 05:27:24 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace gfx
|
|
|
|
} // namespace mozilla
|