PImageBridge.ipdl (2592B)
1 /* -*- Mode: C++; tab-width: 20; 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 6 include LayersSurfaces; 7 include LayersMessages; 8 include protocol PTexture; 9 include ProtocolTypes; 10 include protocol PMediaSystemResourceManager; 11 12 include "mozilla/GfxMessageUtils.h"; 13 include "mozilla/layers/LayersMessageUtils.h"; 14 include "mozilla/layers/WebRenderMessageUtils.h"; 15 16 using struct mozilla::layers::TextureInfo from "mozilla/layers/CompositorTypes.h"; 17 using mozilla::layers::TextureFlags from "mozilla/layers/CompositorTypes.h"; 18 using mozilla::layers::CompositableHandle from "mozilla/layers/LayersTypes.h"; 19 using mozilla::wr::MaybeExternalImageId from "mozilla/webrender/WebRenderTypes.h"; 20 21 namespace mozilla { 22 namespace layers { 23 24 /** 25 * The PImageBridge protocol is used to allow isolated threads or processes to push 26 * frames directly to the compositor thread/process without relying on the main thread 27 * which might be too busy dealing with content script. 28 */ 29 [NeedsOtherPid, ParentProc=compositor, ChildProc=anydom] 30 sync protocol PImageBridge 31 { 32 manages PTexture; 33 manages PMediaSystemResourceManager; 34 35 child: 36 async ParentAsyncMessages(AsyncParentMessageData[] aMessages); 37 38 async DidComposite(ImageCompositeNotification[] aNotifications); 39 40 // Report the number of frames dropped for the given CompositableHost. 41 async ReportFramesDropped(CompositableHandle aHandle, uint32_t aFrames); 42 43 parent: 44 async Update(CompositableOperation[] ops, OpDestroy[] toDestroy, uint64_t fwdTransactionId); 45 46 // First step of the destruction sequence. This puts ImageBridge 47 // in a state in which it can't send asynchronous messages 48 // so as to not race with the channel getting closed. 49 // In the child side, the Closing the channel does not happen right after WillClose, 50 // it is scheduled in the ImageBridgeChild's message queue in order to ensure 51 // that all of the messages from the parent side have been received and processed 52 // before sending closing the channel. 53 async WillClose(); 54 55 async PTexture(SurfaceDescriptor aSharedData, ReadLockDescriptor aReadLock, LayersBackend aBackend, TextureFlags aTextureFlags, uint64_t aSerial, MaybeExternalImageId aExternalImageId); 56 async PMediaSystemResourceManager(); 57 58 sync NewCompositable(CompositableHandle aHandle, TextureInfo aInfo); 59 async ReleaseCompositable(CompositableHandle aHandle); 60 }; 61 62 63 } // namespace 64 } // namespace 65