Bug 1349799 - Add WebGLPowerPreference webidl. - r=qdot
MozReview-Commit-ID: LPojOxWdrr3
--- a/dom/webidl/WebGLRenderingContext.webidl
+++ b/dom/webidl/WebGLRenderingContext.webidl
@@ -27,27 +27,32 @@ typedef long long GLsizeiptr;
// Ideally the typedef below would use 'unsigned byte', but that doesn't currently exist in Web IDL.
typedef octet GLubyte; /* 'octet' should be an unsigned 8 bit type. */
typedef unsigned short GLushort;
typedef unsigned long GLuint;
typedef unrestricted float GLfloat;
typedef unrestricted float GLclampf;
typedef unsigned long long GLuint64EXT;
+// The power preference settings are documented in the WebGLContextAttributes
+// section of the specification.
+enum WebGLPowerPreference { "default", "low-power", "high-performance" };
+
dictionary WebGLContextAttributes {
// boolean alpha = true;
// We deviate from the spec here.
// If alpha isn't specified, we rely on a pref ("webgl.default-no-alpha")
GLboolean alpha;
GLboolean depth = true;
GLboolean stencil = false;
GLboolean antialias = true;
GLboolean premultipliedAlpha = true;
GLboolean preserveDrawingBuffer = false;
GLboolean failIfMajorPerformanceCaveat = false;
+ WebGLPowerPreference powerPreference = "default";
};
[Exposed=(Window,Worker),
Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
interface WebGLBuffer {
};
[Exposed=(Window,Worker),