Bug 1366423 - mDepthTestEnable should be initialized in WebGLContextValidate.cpp - r=jgilbert
authorSamuel Vargas <svargas@mozilla.com>
Fri, 19 May 2017 17:03:59 -0700
changeset 399533 2e881529b6df9f2c8dab47e2545a5005571539bd
parent 399532 6f30a5d2fa33cc7dc51a8714bee4d83165c825a9
child 399534 70768edfd5620271b2451059b8df8eac377f55b6
push id57
push userfmarier@mozilla.com
push dateSat, 24 Jun 2017 00:05:50 +0000
reviewersjgilbert
bugs1366423
milestone55.0a1
Bug 1366423 - mDepthTestEnable should be initialized in WebGLContextValidate.cpp - r=jgilbert
dom/canvas/WebGLContext.cpp
dom/canvas/WebGLContextValidate.cpp
--- a/dom/canvas/WebGLContext.cpp
+++ b/dom/canvas/WebGLContext.cpp
@@ -161,17 +161,16 @@ WebGLContext::WebGLContext()
     mViewportX = 0;
     mViewportY = 0;
     mViewportWidth = 0;
     mViewportHeight = 0;
 
     mDitherEnabled = 1;
     mRasterizerDiscardEnabled = 0; // OpenGL ES 3.0 spec p244
     mScissorTestEnabled = 0;
-    mDepthTestEnabled = 0;
     mStencilTestEnabled = 0;
 
     if (NS_IsMainThread()) {
         // XXX mtseng: bug 709490, not thread safe
         WebGLMemoryTracker::AddWebGLContext(this);
     }
 
     mAllowContextRestore = true;
--- a/dom/canvas/WebGLContextValidate.cpp
+++ b/dom/canvas/WebGLContextValidate.cpp
@@ -448,16 +448,17 @@ WebGLContext::InitAndValidateGL(FailureR
     AssertUintParamCorrect(gl, LOCAL_GL_STENCIL_VALUE_MASK,      mStencilValueMaskFront);
     AssertUintParamCorrect(gl, LOCAL_GL_STENCIL_BACK_VALUE_MASK, mStencilValueMaskBack);
     AssertUintParamCorrect(gl, LOCAL_GL_STENCIL_WRITEMASK,       mStencilWriteMaskFront);
     AssertUintParamCorrect(gl, LOCAL_GL_STENCIL_BACK_WRITEMASK,  mStencilWriteMaskBack);
 
     mDitherEnabled = true;
     mRasterizerDiscardEnabled = false;
     mScissorTestEnabled = false;
+    mDepthTestEnabled = 0;
     mGenerateMipmapHint = LOCAL_GL_DONT_CARE;
 
     // Bindings, etc.
     mActiveTexture = 0;
     mDefaultFB_DrawBuffer0 = LOCAL_GL_BACK;
 
     mEmitContextLostErrorOnce = true;
     mWebGLError = LOCAL_GL_NO_ERROR;