summaryrefslogtreecommitdiff
path: root/gfx/ipc/PGPU.ipdl
blob: a2c035c7519b64668174330203d7c4bc12efc39a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/* -*- 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/. */

include GraphicsMessages;
include protocol PCompositorBridge;
include protocol PImageBridge;
include protocol PVsyncBridge;
include protocol PVideoDecoderManager;

using base::ProcessId from "base/process.h";
using mozilla::TimeDuration from "mozilla/TimeStamp.h";
using mozilla::CSSToLayoutDeviceScale from "Units.h";
using mozilla::gfx::IntSize from "mozilla/gfx/2D.h";
using mozilla::Telemetry::Accumulation from "mozilla/TelemetryComms.h";
using mozilla::Telemetry::KeyedAccumulation from "mozilla/TelemetryComms.h";

namespace mozilla {
namespace gfx {

union GfxPrefValue {
  bool;
  int32_t;
  uint32_t;
  float;
};

struct GfxPrefSetting {
  int32_t index;
  GfxPrefValue value;
};

struct LayerTreeIdMapping {
  uint64_t layersId;
  ProcessId ownerId;
};

sync protocol PGPU
{
parent:
  // Sent by the UI process to initiate core settings.
  async Init(GfxPrefSetting[] prefs,
             GfxVarUpdate[] vars,
             DevicePrefs devicePrefs);

  async InitVsyncBridge(Endpoint<PVsyncBridgeParent> endpoint);
  async InitImageBridge(Endpoint<PImageBridgeParent> endpoint);

  // Called to update a gfx preference or variable.
  async UpdatePref(GfxPrefSetting pref);
  async UpdateVar(GfxVarUpdate var);

  // Create a new top-level compositor.
  async NewWidgetCompositor(Endpoint<PCompositorBridgeParent> endpoint,
                            CSSToLayoutDeviceScale scale,
                            TimeDuration vsyncRate,
                            bool useExternalSurface,
                            IntSize surfaceSize);

  // Create a new content-process compositor bridge.
  async NewContentCompositorBridge(Endpoint<PCompositorBridgeParent> endpoint);
  async NewContentImageBridge(Endpoint<PImageBridgeParent> endpoint);
  async NewContentVideoDecoderManager(Endpoint<PVideoDecoderManagerParent> endpoint);

  // Called to notify the GPU process of who owns a layersId.
  sync AddLayerTreeIdMapping(LayerTreeIdMapping[] mapping);
  async RemoveLayerTreeIdMapping(LayerTreeIdMapping mapping);

  // Request the current DeviceStatus from the GPU process. This blocks until
  // one is available (i.e., Init has completed).
  sync GetDeviceStatus() returns (GPUDeviceData status);

  // Have a message be broadcasted to the GPU process by the GPU process
  // observer service.
  async NotifyGpuObservers(nsCString aTopic);

child:
  // Sent when the GPU process has initialized devices. This occurs once, after
  // Init().
  async InitComplete(GPUDeviceData data);

  // Sent when APZ detects checkerboarding and apz checkerboard reporting is enabled.
  async ReportCheckerboard(uint32_t severity, nsCString log);

  // Graphics errors, analogous to PContent::GraphicsError
  async GraphicsError(nsCString aError);

  // Have a message be broadcasted to the UI process by the UI process
  // observer service.
  async NotifyUiObservers(nsCString aTopic);

  // Messages for reporting telemetry to the UI process.
  async AccumulateChildHistogram(Accumulation[] accumulations);
  async AccumulateChildKeyedHistogram(KeyedAccumulation[] accumulations);

  async NotifyDeviceReset();
};

} // namespace gfx
} // namespace mozilla