diff options
Diffstat (limited to 'components/canvas/webgl_thread.rs')
-rw-r--r-- | components/canvas/webgl_thread.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs index 8b6ae674825..bba93918c70 100644 --- a/components/canvas/webgl_thread.rs +++ b/components/canvas/webgl_thread.rs @@ -8,6 +8,7 @@ use euclid::Size2D; use fnv::FnvHashMap; use gleam::gl; use offscreen_gl_context::{GLContext, GLContextAttributes, GLLimits, NativeGLContextMethods}; +use serde_bytes::ByteBuf; use std::thread; use super::gl_context::{GLContextFactory, GLContextWrapper}; use webrender; @@ -904,10 +905,18 @@ impl WebGLImpl { //} } - fn read_pixels(gl: &gl::Gl, x: i32, y: i32, width: i32, height: i32, format: u32, pixel_type: u32, - chan: WebGLSender<Vec<u8>>) { + fn read_pixels( + gl: &gl::Gl, + x: i32, + y: i32, + width: i32, + height: i32, + format: u32, + pixel_type: u32, + chan: WebGLSender<ByteBuf>, + ) { let result = gl.read_pixels(x, y, width, height, format, pixel_type); - chan.send(result).unwrap() + chan.send(result.into()).unwrap() } fn active_attrib(gl: &gl::Gl, |