Use OpenGl ES on Android (fixes #5785).

This commit is contained in:
Matt Brubeck 2015-04-21 17:20:55 -07:00
parent a3dafe4999
commit a20bc3364c

View file

@ -27,7 +27,7 @@ use compositing::windowing::{MouseWindowEvent, WindowNavigateMsg};
#[cfg(feature = "window")] #[cfg(feature = "window")]
use geom::point::{Point2D, TypedPoint2D}; use geom::point::{Point2D, TypedPoint2D};
#[cfg(feature = "window")] #[cfg(feature = "window")]
use glutin::{ElementState, Event, MouseButton, VirtualKeyCode}; use glutin::{Api, ElementState, Event, GlRequest, MouseButton, VirtualKeyCode};
#[cfg(feature = "window")] #[cfg(feature = "window")]
use msg::constellation_msg::{KeyState, CONTROL, SHIFT, ALT}; use msg::constellation_msg::{KeyState, CONTROL, SHIFT, ALT};
#[cfg(feature = "window")] #[cfg(feature = "window")]
@ -77,7 +77,7 @@ impl Window {
let mut glutin_window = glutin::WindowBuilder::new() let mut glutin_window = glutin::WindowBuilder::new()
.with_title("Servo".to_string()) .with_title("Servo".to_string())
.with_dimensions(window_size.to_untyped().width, window_size.to_untyped().height) .with_dimensions(window_size.to_untyped().width, window_size.to_untyped().height)
.with_gl_version(Window::gl_version()) .with_gl(Window::gl_version())
.with_visibility(is_foreground) .with_visibility(is_foreground)
.build() .build()
.unwrap(); .unwrap();
@ -119,13 +119,13 @@ impl Window {
} }
#[cfg(not(target_os="android"))] #[cfg(not(target_os="android"))]
fn gl_version() -> (u32, u32) { fn gl_version() -> GlRequest {
(3, 0) GlRequest::Specific(Api::OpenGl, (3, 0))
} }
#[cfg(target_os="android")] #[cfg(target_os="android")]
fn gl_version() -> (u32, u32) { fn gl_version() -> GlRequest {
(2, 0) GlRequest::Specific(Api::OpenGlEs, (2, 0))
} }
#[cfg(not(target_os="android"))] #[cfg(not(target_os="android"))]