summaryrefslogtreecommitdiffstats
path: root/gfx/layers/ipc/PCanvas.ipdl
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/layers/ipc/PCanvas.ipdl')
-rw-r--r--gfx/layers/ipc/PCanvas.ipdl93
1 files changed, 93 insertions, 0 deletions
diff --git a/gfx/layers/ipc/PCanvas.ipdl b/gfx/layers/ipc/PCanvas.ipdl
new file mode 100644
index 0000000000..5187e61d23
--- /dev/null
+++ b/gfx/layers/ipc/PCanvas.ipdl
@@ -0,0 +1,93 @@
+/* -*- Mode: C++; 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::TextureType from "mozilla/layers/LayersTypes.h";
+[MoveOnly] using mozilla::ipc::SharedMemoryBasic::Handle from "mozilla/ipc/SharedMemoryBasic.h";
+using mozilla::gfx::BackendType from "mozilla/gfx/Types.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, BackendType aBackendType,
+ Handle aHeaderHandle, Handle[] aBufferHandles,
+ uint64_t aBufferSize,
+ 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(Handle aBufferHandle, uint64_t aBufferSize);
+
+ /**
+ * Sets the shared memory to be used for readback.
+ */
+ async SetDataSurfaceBuffer(Handle aBufferHandle, uint64_t aBufferSize);
+
+ /**
+ * Notify CanvasTranslator it is about to be minimized.
+ */
+ async ClearCachedResources();
+
+ async __delete__();
+
+child:
+ /**
+ * Notify that the canvas device used by the translator has changed.
+ */
+ async NotifyDeviceChanged();
+
+ /**
+ * 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(int64_t aTextureId);
+
+ /**
+ * Cache the shmem of the framebuffer for snapshotting.
+ */
+ async SnapshotShmem(int64_t aTextureId, Handle aShmemHandle, uint32_t aShmemSize) returns (bool aSuccess);
+};
+
+} // layers
+} // mozilla