diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /devtools/shared/specs/webgl.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/shared/specs/webgl.js')
-rw-r--r-- | devtools/shared/specs/webgl.js | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/devtools/shared/specs/webgl.js b/devtools/shared/specs/webgl.js new file mode 100644 index 000000000..f97610f3c --- /dev/null +++ b/devtools/shared/specs/webgl.js @@ -0,0 +1,101 @@ +/* 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/. */ +"use strict"; + +const {Arg, Option, RetVal, generateActorSpec} = require("devtools/shared/protocol"); + +const shaderSpec = generateActorSpec({ + typeName: "gl-shader", + + methods: { + getText: { + response: { text: RetVal("string") } + }, + compile: { + request: { text: Arg(0, "string") }, + response: { error: RetVal("nullable:json") } + }, + }, +}); + +exports.shaderSpec = shaderSpec; + +const programSpec = generateActorSpec({ + typeName: "gl-program", + + methods: { + getVertexShader: { + response: { shader: RetVal("gl-shader") } + }, + getFragmentShader: { + response: { shader: RetVal("gl-shader") } + }, + highlight: { + request: { tint: Arg(0, "array:number") }, + oneway: true + }, + unhighlight: { + oneway: true + }, + blackbox: { + oneway: true + }, + unblackbox: { + oneway: true + }, + } +}); + +exports.programSpec = programSpec; + +const webGLSpec = generateActorSpec({ + typeName: "webgl", + + /** + * Events emitted by this actor. The "program-linked" event is fired every + * time a WebGL program was linked with its respective two shaders. + */ + events: { + "program-linked": { + type: "programLinked", + program: Arg(0, "gl-program") + }, + "global-destroyed": { + type: "globalDestroyed", + program: Arg(0, "number") + }, + "global-created": { + type: "globalCreated", + program: Arg(0, "number") + } + }, + + methods: { + setup: { + request: { reload: Option(0, "boolean") }, + oneway: true + }, + finalize: { + oneway: true + }, + getPrograms: { + response: { programs: RetVal("array:gl-program") } + }, + waitForFrame: { + response: { success: RetVal("nullable:json") } + }, + getPixel: { + request: { + selector: Option(0, "string"), + position: Option(0, "json") + }, + response: { pixels: RetVal("json") } + }, + _getAllPrograms: { + response: { programs: RetVal("array:gl-program") } + } + } +}); + +exports.webGLSpec = webGLSpec; |