diff options
author | Mátyás Mustoha <matyas.mustoha@h-lab.eu> | 2019-03-25 12:50:45 +0100 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2019-05-21 16:56:40 -0400 |
commit | 7f0b820d4ee87351aba9e7c785a704c6c83f135f (patch) | |
tree | 65864ccd58ac2156e59591c82fa07baa757e3ec4 /components/canvas/webgl_thread.rs | |
parent | a14b952fa3eedec86e6308213c525538bcb20827 (diff) | |
download | servo-7f0b820d4ee87351aba9e7c785a704c6c83f135f.tar.gz servo-7f0b820d4ee87351aba9e7c785a704c6c83f135f.zip |
Add initial support for WebGL compressed textures
Diffstat (limited to 'components/canvas/webgl_thread.rs')
-rw-r--r-- | components/canvas/webgl_thread.rs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs index 175a061cbf4..cec8cc929d6 100644 --- a/components/canvas/webgl_thread.rs +++ b/components/canvas/webgl_thread.rs @@ -1168,6 +1168,43 @@ impl WebGLImpl { &pixels, ); }, + WebGLCommand::CompressedTexImage2D { + target, + level, + internal_format, + size, + ref data, + } => { + ctx.gl().compressed_tex_image_2d( + target, + level as i32, + internal_format, + size.width as i32, + size.height as i32, + 0, + &*data, + ); + }, + WebGLCommand::CompressedTexSubImage2D { + target, + level, + xoffset, + yoffset, + size, + format, + ref data, + } => { + ctx.gl().compressed_tex_sub_image_2d( + target, + level as i32, + xoffset as i32, + yoffset as i32, + size.width as i32, + size.height as i32, + format, + &*data, + ); + }, WebGLCommand::DrawingBufferWidth(ref sender) => sender .send(ctx.borrow_draw_buffer().unwrap().size().width) .unwrap(), |