1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
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 PCompositorBridge;
9 include protocol PLayerTransaction;
11 using mozilla::layers::CompositableHandle from "mozilla/layers/LayersTypes.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::webgl::Int32Vector from "mozilla/dom/WebGLIpdl.h";
16 using mozilla::webgl::CompileResult from "mozilla/dom/WebGLIpdl.h";
17 using mozilla::webgl::ContextLossReason from "mozilla/dom/WebGLIpdl.h";
18 using mozilla::webgl::FrontBufferSnapshotIpc from "mozilla/dom/WebGLIpdl.h";
19 using mozilla::webgl::GetUniformData from "mozilla/dom/WebGLIpdl.h";
20 using mozilla::webgl::InitContextDesc from "mozilla/dom/WebGLIpdl.h";
21 using mozilla::webgl::InitContextResult from "mozilla/dom/WebGLIpdl.h";
22 using mozilla::webgl::Int32Vector from "mozilla/dom/WebGLIpdl.h";
23 using mozilla::webgl::LinkResult from "mozilla/dom/WebGLIpdl.h";
24 using mozilla::webgl::ShaderPrecisionFormat from "mozilla/dom/WebGLIpdl.h";
25 using mozilla::webgl::OpaqueFramebufferOptions from "mozilla/dom/WebGLIpdl.h";
26 using mozilla::webgl::ReadPixelsDesc from "mozilla/dom/WebGLIpdl.h";
27 using mozilla::webgl::ReadPixelsResultIpc from "mozilla/dom/WebGLIpdl.h";
28 using mozilla::dom::IpdlQueueBuffer from "mozilla/dom/IpdlQueue.h";
29 using mozilla::dom::IpdlQueueBuffers from "mozilla/dom/IpdlQueue.h";
35 * Represents the connection between a WebGLChild actor that issues WebGL
36 * command from the content process, and a WebGLParent in the compositor
37 * process that runs the commands.
39 sync refcounted protocol PWebGL
41 manager PCompositorBridge;
44 sync Initialize(InitContextDesc desc)
45 returns (InitContextResult res);
51 async DispatchCommands(Shmem commands, uint64_t size);
55 sync GetBufferSubData(uint32_t target, uint64_t srcByteOffset, uint64_t byteSize) returns (Shmem ret);
56 sync GetFrontBufferSnapshot() returns (FrontBufferSnapshotIpc ret);
57 sync ReadPixels(ReadPixelsDesc desc, uint64_t maxBytes) returns (ReadPixelsResultIpc ret);
61 sync CheckFramebufferStatus(uint32_t target) returns (uint32_t ret);
62 sync ClientWaitSync(uint64_t id, uint32_t flags, uint64_t timeout) returns (uint32_t ret);
63 sync CreateOpaqueFramebuffer(uint64_t id, OpaqueFramebufferOptions options) returns (bool ret);
64 sync DrawingBufferSize() returns (uvec2 ret);
66 sync GetBufferParameter(uint32_t target, uint32_t pname) returns (double? ret);
67 sync GetCompileResult(uint64_t id) returns (CompileResult ret);
68 sync GetError() returns (uint32_t ret);
69 sync GetFragDataLocation(uint64_t id, string name) returns (int32_t ret);
70 sync GetFramebufferAttachmentParameter(uint64_t id,
72 uint32_t pname) returns (double? ret);
73 sync GetFrontBuffer(uint64_t fb, bool vr) returns (SurfaceDescriptor? ret);
74 sync GetIndexedParameter(uint32_t target, uint32_t index) returns (double? ret);
75 sync GetInternalformatParameter(uint32_t target, uint32_t internalFormat, uint32_t pname) returns (Int32Vector? ret);
76 sync GetLinkResult(uint64_t id) returns (LinkResult ret);
77 sync GetNumber(uint32_t pname) returns (double? ret);
78 sync GetQueryParameter(uint64_t id, uint32_t pname) returns (double? ret);
79 sync GetRenderbufferParameter(uint64_t id, uint32_t pname) returns (double? ret);
80 sync GetSamplerParameter(uint64_t id, uint32_t pname) returns (double? ret);
81 sync GetShaderPrecisionFormat(
82 uint32_t shaderType, uint32_t precisionType) returns (ShaderPrecisionFormat? ret);
83 sync GetString(uint32_t pname) returns (string? ret);
84 sync GetTexParameter(uint64_t id, uint32_t pname) returns (double? ret);
85 sync GetUniform(uint64_t id, uint32_t loc) returns (GetUniformData ret);
86 sync GetVertexAttrib(uint32_t index, uint32_t pname) returns (double? ret);
87 sync IsEnabled(uint32_t cap) returns (bool ret);
88 sync OnMemoryPressure();
89 sync ValidateProgram(uint64_t id) returns (bool ret);
92 async JsWarning(string text);
94 // Tell client that this queue needs to be shut down
95 async OnContextLoss(ContextLossReason aReason);