diff --git a/gfx/webrender/src/device/gl.rs b/gfx/webrender/src/device/gl.rs index 8e17678167b4..d1f9eedf62c1 100644 --- a/gfx/webrender/src/device/gl.rs +++ b/gfx/webrender/src/device/gl.rs @@ -1024,6 +1024,11 @@ impl Device { ) }; + // Explicitly set some global states to the values we expect. + gl.disable(gl::FRAMEBUFFER_SRGB); + gl.disable(gl::MULTISAMPLE); + gl.disable(gl::POLYGON_SMOOTH); + Device { gl, resource_override_path, @@ -1156,10 +1161,20 @@ impl Device { } } + // If an assertion is hit in this function, something outside of WebRender is likely + // messing with the GL context's global state. + pub fn check_gl_state(&self) { + debug_assert!(self.gl.is_enabled(gl::FRAMEBUFFER_SRGB) == 0); + debug_assert!(self.gl.is_enabled(gl::MULTISAMPLE) == 0); + debug_assert!(self.gl.is_enabled(gl::POLYGON_SMOOTH) == 0); + } + pub fn begin_frame(&mut self) -> GpuFrameId { debug_assert!(!self.inside_frame); self.inside_frame = true; + self.check_gl_state(); + // Retrieve the currently set FBO. let mut default_read_fbo = [0]; unsafe { diff --git a/gfx/webrender_bindings/revision.txt b/gfx/webrender_bindings/revision.txt index c3628b3a8094..abcaf4ba66a8 100644 --- a/gfx/webrender_bindings/revision.txt +++ b/gfx/webrender_bindings/revision.txt @@ -1 +1 @@ -91910a3ce033239fe36ef096223be333ea5df6d7 +596984d1b49f47af65ccfaedd9684b2a90a564e2