Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add destructors to some WebGL objects, remove duplicated glutin dependency and try to enable the webgl reftests #8291

Merged
merged 7 commits into from Nov 2, 2015

servo/main: Load gl symbols in headless mode

This allows running WebGL reftests in wpt.
  • Loading branch information
emilio committed Nov 1, 2015
commit 938a05428aede1ddf65258d2d259baba9a5866b5

Some generated files are not rendered by default. Learn more.

@@ -133,6 +133,9 @@ features = ["plugins"]
[dependencies.gleam]
version = "0.1"

[dependencies.offscreen_gl_context]
git = "https://github.com/ecoal95/rust-offscreen-rendering-context"

[dependencies]
env_logger = "0.3"
time = "0.1.12"
@@ -29,12 +29,25 @@ extern crate log;
extern crate servo;
extern crate time;

extern crate gleam;
extern crate offscreen_gl_context;

use gleam::gl;
use offscreen_gl_context::GLContext;
use servo::Browser;
use servo::compositing::windowing::WindowEvent;
use servo::net_traits::hosts;
use servo::util::opts;
use std::rc::Rc;

#[cfg(not(target_os = "android"))]
fn load_gl_when_headless() {
gl::load_with(|addr| GLContext::get_proc_address(addr) as *const _);
}

#[cfg(target_os = "android")]
fn load_gl_when_headless() {}

fn main() {
env_logger::init().unwrap();

@@ -47,6 +60,9 @@ fn main() {
hosts::global_init();

let window = if opts::get().headless {
// Load gl functions even when in headless mode,
// to avoid crashing with webgl
load_gl_when_headless();
None
} else {
Some(app::create_window(std::ptr::null_mut()))
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.