113 lines
3.8 KiB
Text
113 lines
3.8 KiB
Text
/* -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
* vim: sw=2 ts=8 et : */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
include protocol PCanvasManager;
|
|
include "mozilla/layers/LayersMessageUtils.h";
|
|
include "mozilla/layers/CanvasTranslator.h";
|
|
|
|
[MoveOnly] using mozilla::CrossProcessSemaphoreHandle from "mozilla/ipc/CrossProcessSemaphore.h";
|
|
using mozilla::layers::RemoteTextureOwnerId from "mozilla/layers/LayersTypes.h";
|
|
using mozilla::layers::TextureType from "mozilla/layers/LayersTypes.h";
|
|
using mozilla::gfx::BackendType from "mozilla/gfx/Types.h";
|
|
using mozilla::ipc::ActorId from "mozilla/ipc/ProtocolUtils.h";
|
|
[MoveOnly] using mozilla::ipc::ReadOnlySharedMemoryHandle from "mozilla/ipc/SharedMemoryHandle.h";
|
|
[MoveOnly] using mozilla::ipc::MutableSharedMemoryHandle from "mozilla/ipc/SharedMemoryHandle.h";
|
|
|
|
namespace mozilla {
|
|
namespace layers {
|
|
|
|
/**
|
|
* PCanvas is the IPDL for recorded Canvas drawing.
|
|
*/
|
|
[ParentImpl="CanvasTranslator"]
|
|
async protocol PCanvas {
|
|
manager PCanvasManager;
|
|
|
|
parent:
|
|
/**
|
|
* Initialize a CanvasTranslator for a particular TextureType, which
|
|
* translates events from shared memory buffers. aHeaderHandle is a shared
|
|
* memory handle for the control header. aBufferHandles are shared memory
|
|
* handles for the initial buffers for translation. aBufferSize is the size of
|
|
* each aBufferHandles' memory and the default size. aReaderSem and aWriterSem
|
|
* are handles for the semaphores to handle waiting on either side.
|
|
*/
|
|
async InitTranslator(TextureType aTextureType, TextureType aWebglTextureType,
|
|
BackendType aBackendType, MutableSharedMemoryHandle aHeaderHandle,
|
|
ReadOnlySharedMemoryHandle[] aBufferHandles,
|
|
CrossProcessSemaphoreHandle aReaderSem,
|
|
CrossProcessSemaphoreHandle aWriterSem);
|
|
|
|
/**
|
|
* Restart the translation from a Stopped state.
|
|
*/
|
|
async RestartTranslation();
|
|
|
|
/**
|
|
* Adds a new buffer to be translated. The current buffer will be recycled if
|
|
* it is of the default size. The translation will then be restarted.
|
|
*/
|
|
async AddBuffer(ReadOnlySharedMemoryHandle aBufferHandle);
|
|
|
|
/**
|
|
* Sets the shared memory to be used for readback.
|
|
*/
|
|
async SetDataSurfaceBuffer(MutableSharedMemoryHandle aBufferHandle);
|
|
|
|
/**
|
|
* Notify CanvasTranslator it is about to be minimized.
|
|
*/
|
|
async ClearCachedResources();
|
|
|
|
/**
|
|
* Notify CanvasTranslator when it is dormant.
|
|
*/
|
|
async DropFreeBuffersWhenDormant();
|
|
|
|
/**
|
|
* Snapshot an external canvas and label it for later lookup under a sync-id.
|
|
*/
|
|
async SnapshotExternalCanvas(uint64_t aSyncId, uint32_t aManagerId, ActorId aCanvasId);
|
|
|
|
async __delete__();
|
|
|
|
child:
|
|
/**
|
|
* Notify that the canvas device used by the translator has changed.
|
|
*/
|
|
async NotifyDeviceChanged();
|
|
|
|
/**
|
|
* Notify that the canvas device used by the translator has been reset.
|
|
*/
|
|
async NotifyDeviceReset(RemoteTextureOwnerId[] aOwners);
|
|
|
|
/**
|
|
* Deactivate remote canvas, which will cause fall back to software.
|
|
*/
|
|
async Deactivate();
|
|
|
|
/**
|
|
* Block further accelerated canvases from being created, but allow existing
|
|
* canvases to continue processing.
|
|
*/
|
|
async BlockCanvas();
|
|
|
|
/**
|
|
* Notify that a remote accelerated canvas requires a fallback refresh.
|
|
*/
|
|
async NotifyRequiresRefresh(RemoteTextureOwnerId aTextureOwnerId);
|
|
|
|
/**
|
|
* Cache the shmem of the framebuffer for snapshotting.
|
|
*/
|
|
async SnapshotShmem(RemoteTextureOwnerId aTextureOwnerId, ReadOnlySharedMemoryHandle aShmemHandle) returns (bool aSuccess);
|
|
|
|
async NotifyTextureDestruction(RemoteTextureOwnerId aTextureOwnerId);
|
|
};
|
|
|
|
} // layers
|
|
} // mozilla
|