PCanvasManager.ipdl (1865B)
1 /* -*- Mode: C++; 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 "mozilla/layers/LayersMessageUtils.h"; 9 include protocol PCanvas; 10 include protocol PWebGL; 11 include protocol PWebGPU; 12 13 using mozilla::ipc::ActorId from "mozilla/ipc/ProtocolUtils.h"; 14 using mozilla::layers::RemoteTextureOwnerId from "mozilla/layers/LayersTypes.h"; 15 using mozilla::webgl::FrontBufferSnapshotIpc from "mozilla/dom/WebGLIpdl.h"; 16 using mozilla::webgpu::RawId from "mozilla/webgpu/WebGPUTypes.h"; 17 18 namespace mozilla { 19 namespace gfx { 20 21 /** 22 * The PCanvasManager protocol is the top-level protocol between the main and 23 * worker threads in the content process, and the renderer thread in the 24 * compositor process. This protocol should be used to create accelerated 25 * canvas instances. 26 */ 27 [NeedsOtherPid, ParentProc=compositor, ChildProc=anydom] 28 sync protocol PCanvasManager 29 { 30 manages PCanvas; 31 manages PWebGL; 32 manages PWebGPU; 33 34 parent: 35 async PCanvas(); 36 37 // Actor that represents one WebGL context. 38 async PWebGL(); 39 40 // Actor that represents one WebGPU context. 41 async PWebGPU(); 42 43 // Set the local manager ID for the canvas manager. 44 async Initialize(uint32_t aManagerId); 45 46 // Get the front buffer pixels for the given manager/protocol. This is 47 // intended to be used by the main thread in the content process to block 48 // reading without having to block on the worker thread that owns the context 49 // instance. 50 sync GetSnapshot(uint32_t aManagerId, ActorId aProtocolId, RemoteTextureOwnerId? ownerId, RawId? commandEncoderId, RawId? commandBufferId) returns (FrontBufferSnapshotIpc ret); 51 }; 52 53 } // gfx 54 } // mozilla