PCompositorManager.ipdl (3581B)
1 /* -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * vim: sw=2 ts=8 et : 3 */ 4 /* This Source Code Form is subject to the terms of the Mozilla Public 5 * License, v. 2.0. If a copy of the MPL was not distributed with this 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 7 8 include protocol PCanvasManager; 9 include protocol PCompositorBridge; 10 include LayersSurfaces; 11 include "mozilla/GfxMessageUtils.h"; 12 include "mozilla/layers/WebRenderMessageUtils.h"; 13 14 using mozilla::TimeDuration from "mozilla/TimeStamp.h"; 15 using mozilla::CSSToLayoutDeviceScale from "Units.h"; 16 using mozilla::gfx::IntSize from "mozilla/gfx/2D.h"; 17 using mozilla::layers::CompositorOptions from "mozilla/layers/LayersMessageUtils.h"; 18 using mozilla::wr::ExternalImageId from "mozilla/webrender/WebRenderTypes.h"; 19 using mozilla::wr::MemoryReport from "mozilla/webrender/WebRenderTypes.h"; 20 using mozilla::wr::WebRenderError from "mozilla/webrender/WebRenderTypes.h"; 21 using mozilla::layers::SharedSurfacesMemoryReport from "mozilla/layers/SharedSurfacesMemoryReport.h"; 22 23 namespace mozilla { 24 namespace layers { 25 26 struct WidgetCompositorOptions { 27 CSSToLayoutDeviceScale scale; 28 TimeDuration vsyncRate; 29 CompositorOptions options; 30 bool useExternalSurfaceSize; 31 IntSize surfaceSize; 32 uint64_t innerWindowId; 33 }; 34 35 struct ContentCompositorOptions { 36 }; 37 38 struct SameProcessWidgetCompositorOptions { 39 }; 40 41 union CompositorBridgeOptions { 42 ContentCompositorOptions; 43 WidgetCompositorOptions; 44 SameProcessWidgetCompositorOptions; 45 }; 46 47 /** 48 * The PCompositorManager protocol is the top-level protocol between the 49 * compositor thread and the creators of compositors. It exists in the 50 * following conditions: 51 * - One PCompositorManager between the GPU process and each content process. 52 * If the GPU/UI processes are combined, there is one PCompositorManager 53 * between the combined GPU/UI process and each content process. 54 * - One PCompositorManager between the GPU process and the UI process. If 55 * they are combined, there is still one PCompositorManager, but both the 56 * child and parent live in the same process. 57 * The intention for this protocol is to facilitate communication with the 58 * compositor thread for compositor data that is only shared once, rather than 59 * per PCompositorBridge instance. 60 */ 61 [NeedsOtherPid, ParentProc=compositor, ChildProc=anydom] 62 sync protocol PCompositorManager 63 { 64 manages PCompositorBridge; 65 66 parent: 67 /** 68 * There are three variants of a PCompositorBridge protocol, each of which can 69 * only be created by certain processes and configurations: 70 * - A "content" PCompositorBridge is requested by each content process, 71 * representing the drawable area for Web content. 72 * - A "widget" PCompositorBridge is requested by the UI process for each 73 * "top level browser window" for chrome and such. 74 * - A "same process widget" PCompositorBridge is requested by the combined 75 * GPU/UI process for each "top level browser window" as above. 76 * See gfx/layers/ipc/PCompositorBridge.ipdl for more details. 77 */ 78 async PCompositorBridge(CompositorBridgeOptions options); 79 80 async AddSharedSurface(ExternalImageId aId, SurfaceDescriptorShared aDesc); 81 async RemoveSharedSurface(ExternalImageId aId); 82 async ReportSharedSurfacesMemory() returns (SharedSurfacesMemoryReport aReport); 83 84 async NotifyMemoryPressure(); 85 86 async ReportMemory() returns (MemoryReport aReport); 87 88 async InitCanvasManager(Endpoint<PCanvasManagerParent> endpoint); 89 90 child: 91 async NotifyWebRenderError(WebRenderError error); 92 }; 93 94 } // layers 95 } // mozilla