no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / dom / canvas / PWebGL.ipdl
blob0892a547432cad4f95c381673916b65a61965511
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2  * vim: sw=2 ts=8 et :
3  */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 include protocol PCanvasManager;
9 include "mozilla/layers/LayersMessageUtils.h";
11 [MoveOnly] using class mozilla::ipc::BigBuffer from "mozilla/ipc/BigBuffer.h";
12 using mozilla::layers::SurfaceDescriptor from "mozilla/layers/LayersTypes.h";
13 using std::string from "string";
14 using mozilla::uvec2 from "mozilla/dom/WebGLIpdl.h";
15 using mozilla::uvec3 from "mozilla/dom/WebGLIpdl.h";
16 using mozilla::void_t from "mozilla/ipc/IPCCore.h";
17 using mozilla::webgl::CompileResult from "mozilla/dom/WebGLIpdl.h";
18 using mozilla::webgl::ContextLossReason from "mozilla/dom/WebGLIpdl.h";
19 using mozilla::webgl::FrontBufferSnapshotIpc from "mozilla/dom/WebGLIpdl.h";
20 using mozilla::webgl::GetUniformData from "mozilla/dom/WebGLIpdl.h";
21 using mozilla::webgl::InitContextDesc from "mozilla/dom/WebGLIpdl.h";
22 using mozilla::webgl::InitContextResult from "mozilla/dom/WebGLIpdl.h";
23 using mozilla::webgl::Int32Vector from "mozilla/dom/WebGLIpdl.h";
24 using mozilla::webgl::LinkResult from "mozilla/dom/WebGLIpdl.h";
25 using mozilla::webgl::OpaqueFramebufferOptions from "mozilla/dom/WebGLIpdl.h";
26 using mozilla::webgl::PackingInfo from "mozilla/dom/WebGLIpdl.h";
27 using mozilla::webgl::ReadPixelsDesc from "mozilla/dom/WebGLIpdl.h";
28 using mozilla::webgl::ReadPixelsResultIpc from "mozilla/dom/WebGLIpdl.h";
29 using mozilla::webgl::ShaderPrecisionFormat from "mozilla/dom/WebGLIpdl.h";
30 [MoveOnly] using mozilla::webgl::TexUnpackBlobDesc from "mozilla/dom/WebGLIpdl.h";
32 namespace mozilla {
33 namespace dom {
35 union ReadPixelsBuffer {
36   // The buffer needs to be allocated, and the value specifies the maximum size.
37   uint64_t;
38   // The buffer is a pre-allocated Shmem.
39   Shmem;
42 /**
43  * Represents the connection between a WebGLChild actor that issues WebGL
44  * command from the content process, and a WebGLParent in the compositor
45  * process that runs the commands.
46  */
47 sync protocol PWebGL
49   manager PCanvasManager;
51 parent:
52   sync Initialize(InitContextDesc desc)
53     returns (InitContextResult res);
55   async __delete__();
57   // -
59   async DispatchCommands(BigBuffer commands, uint64_t size);
60   async Ping() returns (void_t ok);
61   sync SyncPing();
62   async TexImage(uint32_t level, uint32_t respecFormat, uvec3 offset,
63                  PackingInfo pi, TexUnpackBlobDesc src);
65   // -
67   sync GetBufferSubData(uint32_t target, uint64_t srcByteOffset, uint64_t byteSize) returns (Shmem ret);
68   sync GetFrontBufferSnapshot() returns (FrontBufferSnapshotIpc ret);
69   sync ReadPixels(ReadPixelsDesc desc, ReadPixelsBuffer buffer) returns (ReadPixelsResultIpc ret);
71   // -
73   sync CheckFramebufferStatus(uint32_t target) returns (uint32_t ret);
74   sync ClientWaitSync(uint64_t id, uint32_t flags, uint64_t timeout) returns (uint32_t ret);
75   sync CreateOpaqueFramebuffer(uint64_t id, OpaqueFramebufferOptions options) returns (bool ret);
76   sync DrawingBufferSize() returns (uvec2 ret);
77   sync Finish();
78   sync GetBufferParameter(uint32_t target, uint32_t pname) returns (double? ret);
79   sync GetCompileResult(uint64_t id) returns (CompileResult ret);
80   sync GetError() returns (uint32_t ret);
81   sync GetFragDataLocation(uint64_t id, string name) returns (int32_t ret);
82   sync GetFramebufferAttachmentParameter(uint64_t id,
83                                                   uint32_t attachment,
84                                                   uint32_t pname) returns (double? ret);
85   sync GetFrontBuffer(uint64_t fb, bool vr) returns (SurfaceDescriptor? ret);
86   sync GetIndexedParameter(uint32_t target, uint32_t index) returns (double? ret);
87   sync GetInternalformatParameter(uint32_t target, uint32_t internalFormat, uint32_t pname) returns (Int32Vector? ret);
88   sync GetLinkResult(uint64_t id) returns (LinkResult ret);
89   sync GetNumber(uint32_t pname) returns (double? ret);
90   sync GetQueryParameter(uint64_t id, uint32_t pname) returns (double? ret);
91   sync GetRenderbufferParameter(uint64_t id, uint32_t pname) returns (double? ret);
92   sync GetSamplerParameter(uint64_t id, uint32_t pname) returns (double? ret);
93   sync GetShaderPrecisionFormat(
94       uint32_t shaderType, uint32_t precisionType) returns (ShaderPrecisionFormat? ret);
95   sync GetString(uint32_t pname) returns (string? ret);
96   sync GetTexParameter(uint64_t id, uint32_t pname) returns (double? ret);
97   sync GetUniform(uint64_t id, uint32_t loc) returns (GetUniformData ret);
98   sync GetVertexAttrib(uint32_t index, uint32_t pname) returns (double? ret);
99   sync IsEnabled(uint32_t cap) returns (bool ret);
100   sync OnMemoryPressure();
101   sync ValidateProgram(uint64_t id) returns (bool ret);
103 child:
104   async JsWarning(string text);
106   // Tell client that this queue needs to be shut down
107   async OnContextLoss(ContextLossReason aReason);
110 } // dom
111 } // mozilla