Support running WebGL in its own thread or on the main thread.

This commit is contained in:
Josh Matthews 2019-07-11 19:41:04 -04:00
parent ad82d67b2e
commit 39d13d1fc8
12 changed files with 429 additions and 202 deletions

View file

@ -51,7 +51,7 @@ impl HeadlessContext {
attribs.push(3);
attribs.push(0);
let share = share.map_or(ptr::null_mut(), |share| share._context as *mut _);
let share = share.map_or(ptr::null_mut(), |share| share.context as *mut _);
let context = unsafe { osmesa_sys::OSMesaCreateContextAttribs(attribs.as_ptr(), share) };

View file

@ -251,7 +251,9 @@ impl ServoGlue {
debug!("perform_updates");
let events = mem::replace(&mut self.events, Vec::new());
self.servo.handle_events(events);
self.handle_servo_events()
let r = self.handle_servo_events();
debug!("done perform_updates");
r
}
/// In batch mode, Servo won't call perform_updates automatically.
@ -628,7 +630,7 @@ impl WindowMethods for ServoWindowCallbacks {
}
fn set_animation_state(&self, state: AnimationState) {
debug!("WindowMethods::set_animation_state");
debug!("WindowMethods::set_animation_state: {:?}", state);
self.host_callbacks
.on_animating_changed(state == AnimationState::Animating);
}