summaryrefslogtreecommitdiffstats
path: root/dom/canvas
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-01-20 22:35:36 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-01-20 22:42:14 +0100
commitc6dbf554496191a0cfe4c8f5dbe8c96031d1445b (patch)
tree72c14ce62e8de6f6f2273799b7badf445ced07d4 /dom/canvas
parent722161775b9ec9314d1b02f567e42b83115cf993 (diff)
downloadUXP-c6dbf554496191a0cfe4c8f5dbe8c96031d1445b.tar
UXP-c6dbf554496191a0cfe4c8f5dbe8c96031d1445b.tar.gz
UXP-c6dbf554496191a0cfe4c8f5dbe8c96031d1445b.tar.lz
UXP-c6dbf554496191a0cfe4c8f5dbe8c96031d1445b.tar.xz
UXP-c6dbf554496191a0cfe4c8f5dbe8c96031d1445b.zip
Issue #1354 - Clear the current context when MakeCurrent() fails.
Diffstat (limited to 'dom/canvas')
-rw-r--r--dom/canvas/WebGLContextValidate.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/dom/canvas/WebGLContextValidate.cpp b/dom/canvas/WebGLContextValidate.cpp
index ebf0aa8c2..30d4c6522 100644
--- a/dom/canvas/WebGLContextValidate.cpp
+++ b/dom/canvas/WebGLContextValidate.cpp
@@ -440,6 +440,13 @@ WebGLContext::InitAndValidateGL(FailureReason* const out_failReason)
{
MOZ_RELEASE_ASSERT(gl, "GFX: GL not initialized");
+ if (!gl->MakeCurrent(true)) {
+ MOZ_ASSERT(false);
+ *out_failReason = { "FEATURE_FAILURE_WEBGL_MAKECURRENT",
+ "Failed to MakeCurrent for init." };
+ return false;
+ }
+
// Unconditionally create a new format usage authority. This is
// important when restoring contexts and extensions need to add
// formats back into the authority.