Bug 1087634 - Update mOptions after context creation. - r=dvander
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 22 Oct 2014 14:17:02 -0700
changeset 212059 31574f16fd054730c3682311dfc5968d2401a69f
parent 212058 ea733dbd670ddb1f63b9fa056947db1fed70e049
child 212060 508d70d4689839b07ce29fa83defa24dc10f7aee
push id27697
push usercbook@mozilla.com
push dateFri, 24 Oct 2014 13:48:53 +0000
treeherdermozilla-central@de805196bbc4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs1087634
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1087634 - Update mOptions after context creation. - r=dvander
dom/canvas/WebGLContext.cpp
--- a/dom/canvas/WebGLContext.cpp
+++ b/dom/canvas/WebGLContext.cpp
@@ -904,35 +904,40 @@ WebGLContext::SetDimensions(int32_t sWid
     ++mGeneration;
 
     MakeContextCurrent();
 
     gl->fViewport(0, 0, mWidth, mHeight);
     mViewportWidth = mWidth;
     mViewportHeight = mHeight;
 
+    // Update mOptions.
+    mOptions.depth = gl->Caps().depth;
+    mOptions.stencil = gl->Caps().stencil;
+    mOptions.antialias = gl->Caps().antialias;
+
     // Make sure that we clear this out, otherwise
     // we'll end up displaying random memory
     gl->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, 0);
 
     AssertCachedBindings();
     AssertCachedState();
 
     // Clear immediately, because we need to present the cleared initial
     // buffer.
     mBackbufferNeedsClear = true;
     ClearBackbufferIfNeeded();
 
     mShouldPresent = true;
 
     MOZ_ASSERT(gl->Caps().color);
     MOZ_ASSERT(gl->Caps().alpha == mOptions.alpha);
-    MOZ_ASSERT(gl->Caps().depth == mOptions.depth || !gl->Caps().depth);
-    MOZ_ASSERT(gl->Caps().stencil == mOptions.stencil || !gl->Caps().stencil);
-    MOZ_ASSERT(gl->Caps().antialias == mOptions.antialias || !gl->Caps().antialias);
+    MOZ_ASSERT(gl->Caps().depth == mOptions.depth);
+    MOZ_ASSERT(gl->Caps().stencil == mOptions.stencil);
+    MOZ_ASSERT(gl->Caps().antialias == mOptions.antialias);
     MOZ_ASSERT(gl->Caps().preserve == mOptions.preserveDrawingBuffer);
 
     if (gl->WorkAroundDriverBugs() && gl->IsANGLE()) {
         if (!mOptions.alpha) {
             mNeedsFakeNoAlpha = true;
         }
     }