PGPU.ipdl 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. include GraphicsMessages;
  6. include protocol PCompositorBridge;
  7. include protocol PImageBridge;
  8. include protocol PVsyncBridge;
  9. include protocol PVideoDecoderManager;
  10. using base::ProcessId from "base/process.h";
  11. using mozilla::TimeDuration from "mozilla/TimeStamp.h";
  12. using mozilla::CSSToLayoutDeviceScale from "Units.h";
  13. using mozilla::gfx::IntSize from "mozilla/gfx/2D.h";
  14. namespace mozilla {
  15. namespace gfx {
  16. union GfxPrefValue {
  17. bool;
  18. int32_t;
  19. uint32_t;
  20. float;
  21. };
  22. struct GfxPrefSetting {
  23. int32_t index;
  24. GfxPrefValue value;
  25. };
  26. struct LayerTreeIdMapping {
  27. uint64_t layersId;
  28. ProcessId ownerId;
  29. };
  30. sync protocol PGPU
  31. {
  32. parent:
  33. // Sent by the UI process to initiate core settings.
  34. async Init(GfxPrefSetting[] prefs,
  35. GfxVarUpdate[] vars,
  36. DevicePrefs devicePrefs);
  37. async InitVsyncBridge(Endpoint<PVsyncBridgeParent> endpoint);
  38. async InitImageBridge(Endpoint<PImageBridgeParent> endpoint);
  39. // Called to update a gfx preference or variable.
  40. async UpdatePref(GfxPrefSetting pref);
  41. async UpdateVar(GfxVarUpdate var);
  42. // Create a new top-level compositor.
  43. async NewWidgetCompositor(Endpoint<PCompositorBridgeParent> endpoint,
  44. CSSToLayoutDeviceScale scale,
  45. TimeDuration vsyncRate,
  46. bool useExternalSurface,
  47. IntSize surfaceSize);
  48. // Create a new content-process compositor bridge.
  49. async NewContentCompositorBridge(Endpoint<PCompositorBridgeParent> endpoint);
  50. async NewContentImageBridge(Endpoint<PImageBridgeParent> endpoint);
  51. async NewContentVideoDecoderManager(Endpoint<PVideoDecoderManagerParent> endpoint);
  52. // Called to notify the GPU process of who owns a layersId.
  53. sync AddLayerTreeIdMapping(LayerTreeIdMapping[] mapping);
  54. async RemoveLayerTreeIdMapping(LayerTreeIdMapping mapping);
  55. // Request the current DeviceStatus from the GPU process. This blocks until
  56. // one is available (i.e., Init has completed).
  57. sync GetDeviceStatus() returns (GPUDeviceData status);
  58. // Have a message be broadcasted to the GPU process by the GPU process
  59. // observer service.
  60. async NotifyGpuObservers(nsCString aTopic);
  61. child:
  62. // Sent when the GPU process has initialized devices. This occurs once, after
  63. // Init().
  64. async InitComplete(GPUDeviceData data);
  65. // Sent when APZ detects checkerboarding and apz checkerboard reporting is enabled.
  66. async ReportCheckerboard(uint32_t severity, nsCString log);
  67. // Graphics errors, analogous to PContent::GraphicsError
  68. async GraphicsError(nsCString aError);
  69. // Have a message be broadcasted to the UI process by the UI process
  70. // observer service.
  71. async NotifyUiObservers(nsCString aTopic);
  72. async NotifyDeviceReset();
  73. };
  74. } // namespace gfx
  75. } // namespace mozilla