diff --git a/platform/android/surface.rs b/platform/android/surface.rs index a19a63e..c0777df 100644 --- a/platform/android/surface.rs +++ b/platform/android/surface.rs @@ -43,15 +43,11 @@ impl Drop for NativePaintingGraphicsContext { fn drop(&mut self) {} } -pub struct NativeCompositingGraphicsContext { - contents: (), -} +pub struct NativeCompositingGraphicsContext; impl NativeCompositingGraphicsContext { pub fn new() -> NativeCompositingGraphicsContext { - NativeCompositingGraphicsContext { - contents: (), - } + NativeCompositingGraphicsContext } } diff --git a/rendergl.rs b/rendergl.rs index a3f23d0..bc423c1 100755 --- a/rendergl.rs +++ b/rendergl.rs @@ -20,13 +20,13 @@ use geom::matrix::{Matrix4, ortho}; use geom::size::Size2D; use libc::c_int; use opengles::gl2::{ARRAY_BUFFER, BLEND, COLOR_BUFFER_BIT, COMPILE_STATUS, FRAGMENT_SHADER}; -use opengles::gl2::{LINK_STATUS, NO_ERROR, ONE_MINUS_SRC_ALPHA}; +use opengles::gl2::{LINK_STATUS, ONE_MINUS_SRC_ALPHA}; use opengles::gl2::{SRC_ALPHA, STATIC_DRAW, TEXTURE_2D, TEXTURE0}; use opengles::gl2::{LINE_STRIP, TRIANGLE_STRIP, VERTEX_SHADER, GLenum, GLfloat, GLint, GLsizei}; use opengles::gl2::{GLuint, active_texture, attach_shader, bind_buffer, bind_texture, blend_func}; use opengles::gl2::{buffer_data, create_program, clear, clear_color, compile_shader}; use opengles::gl2::{create_shader, draw_arrays, enable, enable_vertex_attrib_array, disable_vertex_attrib_array}; -use opengles::gl2::{gen_buffers, get_attrib_location, get_error, get_program_iv}; +use opengles::gl2::{gen_buffers, get_attrib_location, get_program_iv}; use opengles::gl2::{get_shader_info_log, get_shader_iv, get_uniform_location, line_width}; use opengles::gl2::{link_program, shader_source, uniform_1i, uniform_2f, uniform_4f}; use opengles::gl2::{uniform_matrix_4fv, use_program, vertex_attrib_pointer_f32, viewport}; @@ -47,6 +47,7 @@ static FRAGMENT_2D_SHADER_SOURCE: &'static str = " } "; +#[cfg(not(target_os="android"))] static FRAGMENT_RECTANGLE_SHADER_SOURCE: &'static str = " #ifdef GL_ES precision mediump float; @@ -123,13 +124,8 @@ pub fn load_shader(source_string: &str, shader_type: GLenum) -> GLuint { shader_source(shader_id, [ source_string.as_bytes() ]); compile_shader(shader_id); - if get_error() != NO_ERROR { - println!("error: {:d}", get_error() as int); - fail!("failed to compile shader"); - } - if get_shader_iv(shader_id, COMPILE_STATUS) == (0 as GLint) { - println!("shader info log: {:s}", get_shader_info_log(shader_id)); + debug!("shader info log: {:s}", get_shader_info_log(shader_id)); fail!("failed to compile shader"); } @@ -206,6 +202,7 @@ struct TextureRectangleProgram { } impl TextureRectangleProgram { + #[cfg(not(target_os="android"))] fn new() -> TextureRectangleProgram { let vertex_shader = load_shader(VERTEX_SHADER_SOURCE, VERTEX_SHADER); let fragment_shader = load_shader(FRAGMENT_RECTANGLE_SHADER_SOURCE, FRAGMENT_SHADER); @@ -222,8 +219,7 @@ impl TextureRectangleProgram { } } - #[cfg(target_os="linux")] - #[cfg(target_os="macos")] + #[cfg(not(target_os="android"))] fn create_if_necessary() -> Option { use opengles::gl2::TEXTURE_RECTANGLE_ARB; enable(TEXTURE_RECTANGLE_ARB);