Auto merge of #27168 - jdm:gl-fake-context-lost, r=Manishearth

Add stub isContextLost API.

We don't support losing contexts yet, so it's not lying to say that the context is never lost.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #27116
- [x] There are tests for these changes
This commit is contained in:
bors-servo 2020-07-06 14:56:50 -04:00 committed by GitHub
commit 22a7522a04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 24 deletions

View file

@ -1119,6 +1119,11 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
self.base.GetContextAttributes() self.base.GetContextAttributes()
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.13
fn IsContextLost(&self) -> bool {
self.base.IsContextLost()
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.14 /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.14
fn GetSupportedExtensions(&self) -> Option<Vec<DOMString>> { fn GetSupportedExtensions(&self) -> Option<Vec<DOMString>> {
self.base.GetSupportedExtensions() self.base.GetSupportedExtensions()

View file

@ -2319,6 +2319,11 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}) })
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.13
fn IsContextLost(&self) -> bool {
false
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.14 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.14
fn GetSupportedExtensions(&self) -> Option<Vec<DOMString>> { fn GetSupportedExtensions(&self) -> Option<Vec<DOMString>> {
self.extension_manager self.extension_manager

View file

@ -470,8 +470,7 @@ interface mixin WebGLRenderingContextBase
readonly attribute GLsizei drawingBufferHeight; readonly attribute GLsizei drawingBufferHeight;
[WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes(); [WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes();
// FIXME: https://github.com/servo/servo/issues/15266 [WebGLHandlesContextLoss] boolean isContextLost();
// [WebGLHandlesContextLoss] boolean isContextLost();
sequence<DOMString>? getSupportedExtensions(); sequence<DOMString>? getSupportedExtensions();
object? getExtension(DOMString name); object? getExtension(DOMString name);

View file

@ -1,5 +0,0 @@
[context-lost.html]
bug: https://github.com/servo/servo/issues/15266
[WebGL test #0: gl.isContextLost() should be false. Threw exception TypeError: gl.isContextLost is not a function]
expected: FAIL

View file

@ -1,7 +1,4 @@
[methods.html] [methods.html]
bug: https://github.com/servo/servo/issues/15266
[WebGL test #0: Property either does not exist or is not a function: isContextLost]
expected: FAIL
[WebGL test #1: Also found the following extra methods:] [WebGL test #1: Also found the following extra methods:]
expected: FAIL expected: FAIL
[WebGL test #2: makeXRCompatible] [WebGL test #2: makeXRCompatible]

View file

@ -1,5 +0,0 @@
[methods.html]
bug: https://github.com/servo/servo/issues/15266
[WebGL test #0: testOES20Methods]
expected: FAIL

View file

@ -1,22 +1,19 @@
[methods-2.html] [methods-2.html]
[WebGL test #1: Property either does not exist or is not a function: blitFramebuffer] [WebGL test #0: Property either does not exist or is not a function: blitFramebuffer]
expected: FAIL expected: FAIL
[WebGL test #4: Property either does not exist or is not a function: copyTexSubImage3D] [WebGL test #3: Property either does not exist or is not a function: copyTexSubImage3D]
expected: FAIL expected: FAIL
[WebGL test #5: Property either does not exist or is not a function: compressedTexImage3D] [WebGL test #4: Property either does not exist or is not a function: compressedTexImage3D]
expected: FAIL expected: FAIL
[WebGL test #2: Property either does not exist or is not a function: texImage3D] [WebGL test #1: Property either does not exist or is not a function: texImage3D]
expected: FAIL expected: FAIL
[WebGL test #3: Property either does not exist or is not a function: texSubImage3D] [WebGL test #2: Property either does not exist or is not a function: texSubImage3D]
expected: FAIL expected: FAIL
[WebGL test #6: Property either does not exist or is not a function: compressedTexSubImage3D] [WebGL test #5: Property either does not exist or is not a function: compressedTexSubImage3D]
expected: FAIL
[WebGL test #0: Property either does not exist or is not a function: isContextLost]
expected: FAIL expected: FAIL