diff --git a/dom/canvas/WebGLContext.h b/dom/canvas/WebGLContext.h index 78ea4dd47295..8dd1c36f410d 100644 --- a/dom/canvas/WebGLContext.h +++ b/dom/canvas/WebGLContext.h @@ -974,6 +974,7 @@ private: realGLboolean mScissorTestEnabled; realGLboolean mDepthTestEnabled; realGLboolean mStencilTestEnabled; + GLenum mGenerateMipmapHint; bool ValidateCapabilityEnum(GLenum cap, const char* info); realGLboolean* GetStateTrackingSlot(GLenum cap); diff --git a/dom/canvas/WebGLContextGL.cpp b/dom/canvas/WebGLContextGL.cpp index acf1e2222d38..a84aca590731 100644 --- a/dom/canvas/WebGLContextGL.cpp +++ b/dom/canvas/WebGLContextGL.cpp @@ -947,6 +947,8 @@ WebGLContext::Hint(GLenum target, GLenum mode) switch (target) { case LOCAL_GL_GENERATE_MIPMAP_HINT: + mGenerateMipmapHint = mode; + // Deprecated and removed in desktop GL Core profiles. if (gl->IsCoreProfile()) return; diff --git a/dom/canvas/WebGLContextState.cpp b/dom/canvas/WebGLContextState.cpp index 12f890df03cd..adb7fb7dd429 100644 --- a/dom/canvas/WebGLContextState.cpp +++ b/dom/canvas/WebGLContextState.cpp @@ -386,12 +386,15 @@ WebGLContext::GetParameter(JSContext* cx, GLenum pname, ErrorResult& rv) case LOCAL_GL_BLEND_DST_RGB: case LOCAL_GL_BLEND_DST_ALPHA: case LOCAL_GL_BLEND_EQUATION_RGB: - case LOCAL_GL_BLEND_EQUATION_ALPHA: - case LOCAL_GL_GENERATE_MIPMAP_HINT: { + case LOCAL_GL_BLEND_EQUATION_ALPHA: { GLint i = 0; gl->fGetIntegerv(pname, &i); return JS::NumberValue(uint32_t(i)); } + + case LOCAL_GL_GENERATE_MIPMAP_HINT: + return JS::NumberValue(mGenerateMipmapHint); + case LOCAL_GL_IMPLEMENTATION_COLOR_READ_TYPE: { const webgl::FormatUsageInfo* usage; uint32_t width, height; diff --git a/dom/canvas/WebGLContextValidate.cpp b/dom/canvas/WebGLContextValidate.cpp index 03367140503a..1901ca10a05c 100644 --- a/dom/canvas/WebGLContextValidate.cpp +++ b/dom/canvas/WebGLContextValidate.cpp @@ -501,6 +501,7 @@ WebGLContext::InitAndValidateGL(FailureReason* const out_failReason) mDitherEnabled = true; mRasterizerDiscardEnabled = false; mScissorTestEnabled = false; + mGenerateMipmapHint = LOCAL_GL_DONT_CARE; // Bindings, etc. mActiveTexture = 0;