PCanvas.ipdl (3769B)
1 /* -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * vim: sw=2 ts=8 et : */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 include protocol PCanvasManager; 8 include "mozilla/layers/LayersMessageUtils.h"; 9 include "mozilla/layers/CanvasTranslator.h"; 10 11 [MoveOnly] using mozilla::CrossProcessSemaphoreHandle from "mozilla/ipc/CrossProcessSemaphore.h"; 12 using mozilla::layers::RemoteTextureOwnerId from "mozilla/layers/LayersTypes.h"; 13 using mozilla::layers::TextureType from "mozilla/layers/LayersTypes.h"; 14 using mozilla::gfx::BackendType from "mozilla/gfx/Types.h"; 15 using mozilla::ipc::ActorId from "mozilla/ipc/ProtocolUtils.h"; 16 [MoveOnly] using mozilla::ipc::ReadOnlySharedMemoryHandle from "mozilla/ipc/SharedMemoryHandle.h"; 17 [MoveOnly] using mozilla::ipc::MutableSharedMemoryHandle from "mozilla/ipc/SharedMemoryHandle.h"; 18 19 namespace mozilla { 20 namespace layers { 21 22 /** 23 * PCanvas is the IPDL for recorded Canvas drawing. 24 */ 25 [ParentImpl="CanvasTranslator"] 26 async protocol PCanvas { 27 manager PCanvasManager; 28 29 parent: 30 /** 31 * Initialize a CanvasTranslator for a particular TextureType, which 32 * translates events from shared memory buffers. aHeaderHandle is a shared 33 * memory handle for the control header. aBufferHandles are shared memory 34 * handles for the initial buffers for translation. aBufferSize is the size of 35 * each aBufferHandles' memory and the default size. aReaderSem and aWriterSem 36 * are handles for the semaphores to handle waiting on either side. 37 */ 38 async InitTranslator(TextureType aTextureType, TextureType aWebglTextureType, 39 BackendType aBackendType, MutableSharedMemoryHandle aHeaderHandle, 40 ReadOnlySharedMemoryHandle[] aBufferHandles, 41 CrossProcessSemaphoreHandle aReaderSem, 42 CrossProcessSemaphoreHandle aWriterSem); 43 44 /** 45 * Restart the translation from a Stopped state. 46 */ 47 async RestartTranslation(); 48 49 /** 50 * Adds a new buffer to be translated. The current buffer will be recycled if 51 * it is of the default size. The translation will then be restarted. 52 */ 53 async AddBuffer(ReadOnlySharedMemoryHandle aBufferHandle); 54 55 /** 56 * Sets the shared memory to be used for readback. 57 */ 58 async SetDataSurfaceBuffer(uint32_t aId, MutableSharedMemoryHandle aBufferHandle); 59 60 /** 61 * Notify CanvasTranslator it is about to be minimized. 62 */ 63 async ClearCachedResources(); 64 65 /** 66 * Notify CanvasTranslator when it is dormant. 67 */ 68 async DropFreeBuffersWhenDormant(); 69 70 /** 71 * Snapshot an external canvas and label it for later lookup under a sync-id. 72 */ 73 async SnapshotExternalCanvas(uint64_t aSyncId, uint32_t aManagerId, ActorId aCanvasId); 74 75 async __delete__(); 76 77 child: 78 /** 79 * Notify that the canvas device used by the translator has been reset. 80 */ 81 async NotifyDeviceReset(RemoteTextureOwnerId[] aOwners); 82 83 /** 84 * Deactivate remote canvas, which will cause fall back to software. 85 */ 86 async Deactivate(); 87 88 /** 89 * Block further accelerated canvases from being created, but allow existing 90 * canvases to continue processing. 91 */ 92 async BlockCanvas(); 93 94 /** 95 * Notify that a remote accelerated canvas requires a fallback refresh. 96 */ 97 async NotifyRequiresRefresh(RemoteTextureOwnerId aTextureOwnerId); 98 99 /** 100 * Cache the shmem of the framebuffer for snapshotting. 101 */ 102 async SnapshotShmem(RemoteTextureOwnerId aTextureOwnerId, ReadOnlySharedMemoryHandle aShmemHandle) returns (bool aSuccess); 103 104 async NotifyTextureDestruction(RemoteTextureOwnerId aTextureOwnerId); 105 }; 106 107 } // layers 108 } // mozilla