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

Update offscreen_gl_context #9044

Merged
merged 3 commits into from Dec 23, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -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
@@ -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.

@@ -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"
@@ -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<i32>,
original_context_size: Size2D<i32>,
gl_context: GLContext,
gl_context: GLContext<NativeGLContext>,
}

// This allows trying to create the PaintTask
@@ -29,9 +29,7 @@ unsafe impl Send for WebGLPaintTask {}

impl WebGLPaintTask {
fn new(size: Size2D<i32>, attrs: GLContextAttributes) -> Result<WebGLPaintTask, &'static str> {
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
@@ -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"
@@ -18,7 +18,6 @@ path = "../net_traits"

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

[dependencies.plugins]
path = "../plugins"

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

@@ -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::<NativeGLContext>::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 {

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

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

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.