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