From 59d74cdb1f50dd39ad78946c9aa810fac8b281c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 23 Dec 2015 20:06:37 +0501 Subject: [PATCH] servo: Merge #9044 - Update offscreen_gl_context (from emilio:offscreen-gl-up); r=jdm cc: https://github.com/ecoal95/rust-offscreen-rendering-context/pull/46 Source-Repo: https://github.com/servo/servo Source-Revision: da8952b7023a92b7a69bd4423905594f4baa8f29 --- servo/.travis.yml | 3 ++- servo/README.md | 3 ++- servo/components/canvas/Cargo.toml | 1 - servo/components/canvas/webgl_paint_task.rs | 8 +++----- servo/components/compositing/Cargo.toml | 1 - servo/components/script_traits/Cargo.toml | 1 - servo/components/servo/Cargo.lock | 4 +--- servo/components/servo/main.rs | 6 +++--- servo/ports/cef/Cargo.lock | 4 +--- servo/ports/gonk/Cargo.lock | 4 +--- 10 files changed, 13 insertions(+), 22 deletions(-) diff --git a/servo/.travis.yml b/servo/.travis.yml index 53b18fb0d6fe..319d5ac19ff8 100644 --- a/servo/.travis.yml +++ b/servo/.travis.yml @@ -12,7 +12,7 @@ matrix: - ./mach build -d --verbose - ./mach test-unit - bash etc/ci/lockfile_changed.sh - - bash etc/ci/manifest_changed.sh + - bash etc/ci/manifest_changed.sh cache: directories: - .cargo @@ -26,6 +26,7 @@ matrix: - freeglut3-dev - gperf - libosmesa6-dev + - libgles2-mesa-dev - python-virtualenv - xorg-dev - ccache diff --git a/servo/README.md b/servo/README.md index 879d5f6ac8ed..2c1244343521 100644 --- a/servo/README.md +++ b/servo/README.md @@ -31,7 +31,8 @@ On Debian-based Linuxes: sudo apt-get install curl freeglut3-dev \ libfreetype6-dev libgl1-mesa-dri libglib2.0-dev xorg-dev \ gperf g++ cmake python-virtualenv python-pip \ - libssl-dev libbz2-dev libosmesa6-dev libxmu6 libxmu-dev libglu1-mesa-dev + libssl-dev libbz2-dev libosmesa6-dev libxmu6 libxmu-dev \ + libglu1-mesa-dev libgles2-mesa-dev ``` If you are on **Ubuntu 14.04** and encountered errors on installing these dependencies involving `libcheese`, see [#6158](https://github.com/servo/servo/issues/6158) for a workaround. diff --git a/servo/components/canvas/Cargo.toml b/servo/components/canvas/Cargo.toml index c1bc9a884351..6e930730df82 100644 --- a/servo/components/canvas/Cargo.toml +++ b/servo/components/canvas/Cargo.toml @@ -29,7 +29,6 @@ path = "../gfx_traits" [dependencies.offscreen_gl_context] git = "https://github.com/ecoal95/rust-offscreen-rendering-context" -features = ["texture_surface"] [dependencies.ipc-channel] git = "https://github.com/servo/ipc-channel" diff --git a/servo/components/canvas/webgl_paint_task.rs b/servo/components/canvas/webgl_paint_task.rs index 2073c0ccf817..a765f93a109b 100644 --- a/servo/components/canvas/webgl_paint_task.rs +++ b/servo/components/canvas/webgl_paint_task.rs @@ -11,7 +11,7 @@ use gleam::gl::types::{GLsizei}; use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory}; use ipc_channel::router::ROUTER; use layers::platform::surface::NativeSurface; -use offscreen_gl_context::{ColorAttachmentType, GLContext, GLContextAttributes}; +use offscreen_gl_context::{ColorAttachmentType, GLContext, GLContextAttributes, NativeGLContext}; use std::borrow::ToOwned; use std::sync::mpsc::{Sender, channel}; use util::task::spawn_named; @@ -20,7 +20,7 @@ use util::vec::byte_swap; pub struct WebGLPaintTask { size: Size2D, original_context_size: Size2D, - gl_context: GLContext, + gl_context: GLContext, } // This allows trying to create the PaintTask @@ -29,9 +29,7 @@ unsafe impl Send for WebGLPaintTask {} impl WebGLPaintTask { fn new(size: Size2D, attrs: GLContextAttributes) -> Result { - let context = try!( - GLContext::create_offscreen_with_color_attachment( - size, attrs, ColorAttachmentType::TextureWithSurface)); + let context = try!(GLContext::new(size, attrs, ColorAttachmentType::Texture, None)); // NOTE: As of right now this is always equal to the size parameter, // but this doesn't have to be true. Firefox after failing with diff --git a/servo/components/compositing/Cargo.toml b/servo/components/compositing/Cargo.toml index f49d15ba2c31..3dad2b631101 100644 --- a/servo/components/compositing/Cargo.toml +++ b/servo/components/compositing/Cargo.toml @@ -62,7 +62,6 @@ git = "https://github.com/servo/ipc-channel" [dependencies.offscreen_gl_context] git = "https://github.com/ecoal95/rust-offscreen-rendering-context" -features = ["texture_surface"] [dependencies.gaol] git = "https://github.com/pcwalton/gaol" diff --git a/servo/components/script_traits/Cargo.toml b/servo/components/script_traits/Cargo.toml index 1d53b0c5869b..c47bec153ca6 100644 --- a/servo/components/script_traits/Cargo.toml +++ b/servo/components/script_traits/Cargo.toml @@ -21,7 +21,6 @@ path = "../net_traits" [dependencies.offscreen_gl_context] git = "https://github.com/ecoal95/rust-offscreen-rendering-context" -features = ["texture_surface"] [dependencies.plugins] path = "../plugins" diff --git a/servo/components/servo/Cargo.lock b/servo/components/servo/Cargo.lock index 51035235d0a5..667f21446e54 100644 --- a/servo/components/servo/Cargo.lock +++ b/servo/components/servo/Cargo.lock @@ -1266,7 +1266,7 @@ dependencies = [ [[package]] name = "offscreen_gl_context" version = "0.1.0" -source = "git+https://github.com/ecoal95/rust-offscreen-rendering-context#348364d8869d5e673b49c60f40803dfa903c70f2" +source = "git+https://github.com/ecoal95/rust-offscreen-rendering-context#0677179502384f07fced16744dbe5882d9a71dfa" dependencies = [ "cgl 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1274,11 +1274,9 @@ dependencies = [ "gl_generator 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "layers 0.2.0 (git+https://github.com/servo/rust-layers)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "servo-glutin 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "x11 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/servo/components/servo/main.rs b/servo/components/servo/main.rs index 7b3f6ead2c27..47d275727a29 100644 --- a/servo/components/servo/main.rs +++ b/servo/components/servo/main.rs @@ -34,7 +34,7 @@ extern crate servo; extern crate time; use gleam::gl; -use offscreen_gl_context::GLContext; +use offscreen_gl_context::{GLContext, NativeGLContext}; use servo::Browser; use servo::compositing::windowing::WindowEvent; use servo::net_traits::hosts; @@ -43,7 +43,7 @@ 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 _); + gl::load_with(|addr| GLContext::::get_proc_address(addr) as *const _); } #[cfg(target_os = "android")] @@ -76,7 +76,7 @@ fn main() { let window = if opts::get().headless { // Load gl functions even when in headless mode, - // to avoid crashing with webgl + // to avoid crashing with WebGL load_gl_when_headless(); None } else { diff --git a/servo/ports/cef/Cargo.lock b/servo/ports/cef/Cargo.lock index 7c2e3c488bed..79512fdbfc36 100644 --- a/servo/ports/cef/Cargo.lock +++ b/servo/ports/cef/Cargo.lock @@ -1201,7 +1201,7 @@ dependencies = [ [[package]] name = "offscreen_gl_context" version = "0.1.0" -source = "git+https://github.com/ecoal95/rust-offscreen-rendering-context#348364d8869d5e673b49c60f40803dfa903c70f2" +source = "git+https://github.com/ecoal95/rust-offscreen-rendering-context#0677179502384f07fced16744dbe5882d9a71dfa" dependencies = [ "cgl 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1209,11 +1209,9 @@ dependencies = [ "gl_generator 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "layers 0.2.0 (git+https://github.com/servo/rust-layers)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "servo-glutin 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "x11 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/servo/ports/gonk/Cargo.lock b/servo/ports/gonk/Cargo.lock index 3c18731468e9..541b16329242 100644 --- a/servo/ports/gonk/Cargo.lock +++ b/servo/ports/gonk/Cargo.lock @@ -1169,7 +1169,7 @@ dependencies = [ [[package]] name = "offscreen_gl_context" version = "0.1.0" -source = "git+https://github.com/ecoal95/rust-offscreen-rendering-context#348364d8869d5e673b49c60f40803dfa903c70f2" +source = "git+https://github.com/ecoal95/rust-offscreen-rendering-context#0677179502384f07fced16744dbe5882d9a71dfa" dependencies = [ "cgl 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1177,11 +1177,9 @@ dependencies = [ "gl_generator 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "layers 0.2.0 (git+https://github.com/servo/rust-layers)", "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde_macros 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "servo-glutin 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "x11 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ]