webgl: Add feature to store backtraces for each WebGL API call for easier debugging.

This commit is contained in:
Josh Matthews 2018-08-01 14:50:40 -04:00
parent 515afac456
commit 5dc80dd07a
12 changed files with 82 additions and 16 deletions

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use canvas_traits::webgl::{WebGLCommand, WebGLVersion};
use canvas_traits::webgl::{WebGLCommand, WebGLVersion, WebGLCommandBacktrace};
use compositing::compositor_thread::{CompositorProxy, self};
use euclid::Size2D;
use gleam::gl;
@ -144,13 +144,18 @@ impl GLContextWrapper {
}
}
pub fn apply_command(&self, cmd: WebGLCommand, state: &mut GLState) {
pub fn apply_command(
&self,
cmd: WebGLCommand,
backtrace: WebGLCommandBacktrace,
state: &mut GLState
) {
match *self {
GLContextWrapper::Native(ref ctx) => {
WebGLImpl::apply(ctx, state, cmd);
WebGLImpl::apply(ctx, state, cmd, backtrace);
}
GLContextWrapper::OSMesa(ref ctx) => {
WebGLImpl::apply(ctx, state, cmd);
WebGLImpl::apply(ctx, state, cmd, backtrace);
}
}
}