aboutsummaryrefslogtreecommitdiffstats
path: root/components/canvas/webgl_thread.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2018-09-08 13:05:05 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2018-09-08 13:42:06 +0200
commit4bd8efa49e439034c545b01f26056a3871f2d45c (patch)
tree8f208cce13a3a6247e95c58f02c56dc1caa72e51 /components/canvas/webgl_thread.rs
parent408e540c55fce1915e4875ba336a5d6f01fb1893 (diff)
downloadservo-4bd8efa49e439034c545b01f26056a3871f2d45c.tar.gz
servo-4bd8efa49e439034c545b01f26056a3871f2d45c.zip
Use byte channels to send textures to the WebGL thread
Diffstat (limited to 'components/canvas/webgl_thread.rs')
-rw-r--r--components/canvas/webgl_thread.rs31
1 files changed, 26 insertions, 5 deletions
diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs
index 8945ce6a925..efbb4ca71c5 100644
--- a/components/canvas/webgl_thread.rs
+++ b/components/canvas/webgl_thread.rs
@@ -834,11 +834,32 @@ impl WebGLImpl {
WebGLCommand::SetViewport(x, y, width, height) => {
ctx.gl().viewport(x, y, width, height);
}
- WebGLCommand::TexImage2D(target, level, internal, width, height, format, data_type, ref data) =>
- ctx.gl().tex_image_2d(target, level, internal, width, height,
- /*border*/0, format, data_type, Some(data)),
- WebGLCommand::TexSubImage2D(target, level, xoffset, yoffset, x, y, width, height, ref data) =>
- ctx.gl().tex_sub_image_2d(target, level, xoffset, yoffset, x, y, width, height, data),
+ WebGLCommand::TexImage2D(target, level, internal, width, height, format, data_type, ref chan) => {
+ ctx.gl().tex_image_2d(
+ target,
+ level,
+ internal,
+ width,
+ height,
+ 0,
+ format,
+ data_type,
+ Some(&chan.recv().unwrap()),
+ )
+ }
+ WebGLCommand::TexSubImage2D(target, level, xoffset, yoffset, x, y, width, height, ref chan) => {
+ ctx.gl().tex_sub_image_2d(
+ target,
+ level,
+ xoffset,
+ yoffset,
+ x,
+ y,
+ width,
+ height,
+ &chan.recv().unwrap(),
+ )
+ }
WebGLCommand::DrawingBufferWidth(ref sender) =>
sender.send(ctx.borrow_draw_buffer().unwrap().size().width).unwrap(),
WebGLCommand::DrawingBufferHeight(ref sender) =>