From d0be04cef96ed38097c02693b48a8eeb259bfabd Mon Sep 17 00:00:00 2001 From: Kyle Date: Fri, 24 Jul 2015 13:55:46 -0400 Subject: [PATCH] Bug 1175931 - TexImageFromVideoElement uses GL_HALF_FLOAT if it does not support GL_HALF_FLOAT_OES which would be the case on non-ANGLE systems. Using GL_HALF_FLOAT_OES on a non OES system would result in an error when using TexImage2D. r=jgilbert --- dom/canvas/WebGLContext.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dom/canvas/WebGLContext.cpp b/dom/canvas/WebGLContext.cpp index 2db6fb4a13d..b9f9efa527d 100644 --- a/dom/canvas/WebGLContext.cpp +++ b/dom/canvas/WebGLContext.cpp @@ -1825,6 +1825,12 @@ WebGLContext::TexImageFromVideoElement(const TexImageTarget texImageTarget, GLenum format, GLenum type, mozilla::dom::Element& elt) { + if (type == LOCAL_GL_HALF_FLOAT_OES && + !gl->IsExtensionSupported(gl::GLContext::OES_texture_half_float)) + { + type = LOCAL_GL_HALF_FLOAT; + } + if (!ValidateTexImageFormatAndType(format, type, WebGLTexImageFunc::TexImage, WebGLTexDimensions::Tex2D))