aboutsummaryrefslogtreecommitdiffstats
path: root/components/canvas/webgl_thread.rs
diff options
context:
space:
mode:
authorAlan Jeffrey <ajeffrey@mozilla.com>2019-07-23 18:21:48 -0500
committerAlan Jeffrey <ajeffrey@mozilla.com>2019-07-26 23:36:13 -0500
commit133a17e15c4110fe7a5f0933bb50842bb3eeeccb (patch)
tree58ea434cff337bd8508a88bd743e66da073a00bc /components/canvas/webgl_thread.rs
parent5c8fee4e0bdf01efc83f4db10a60ac1629db6795 (diff)
downloadservo-133a17e15c4110fe7a5f0933bb50842bb3eeeccb.tar.gz
servo-133a17e15c4110fe7a5f0933bb50842bb3eeeccb.zip
Replace use of callbacks in webxr by channels
Diffstat (limited to 'components/canvas/webgl_thread.rs')
-rw-r--r--components/canvas/webgl_thread.rs22
1 files changed, 2 insertions, 20 deletions
diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs
index 01262de02f2..f2099094127 100644
--- a/components/canvas/webgl_thread.rs
+++ b/components/canvas/webgl_thread.rs
@@ -10,7 +10,7 @@ use euclid::default::Size2D;
use fnv::FnvHashMap;
use gleam::gl;
use half::f16;
-use ipc_channel::ipc::{self, IpcSender, OpaqueIpcMessage};
+use ipc_channel::ipc::{self, OpaqueIpcMessage};
use ipc_channel::router::ROUTER;
use offscreen_gl_context::{DrawBuffer, GLContext, NativeGLContextMethods};
use pixels::{self, PixelFormat};
@@ -284,9 +284,6 @@ impl WebGLThread {
WebGLMsg::Lock(ctx_id, sender) => {
self.handle_lock(ctx_id, sender);
},
- WebGLMsg::LockIPC(ctx_id, sender) => {
- self.handle_lock_ipc(ctx_id, sender);
- },
WebGLMsg::Unlock(ctx_id) => {
self.handle_unlock(ctx_id);
},
@@ -343,21 +340,6 @@ impl WebGLThread {
context_id: WebGLContextId,
sender: WebGLSender<(u32, Size2D<i32>, usize)>,
) {
- sender.send(self.handle_lock_sync(context_id)).unwrap();
- }
-
- /// handle_lock, but unconditionally IPC (used by webxr)
- fn handle_lock_ipc(
- &mut self,
- context_id: WebGLContextId,
- sender: IpcSender<(u32, Size2D<i32>, usize)>,
- ) {
- sender.send(self.handle_lock_sync(context_id)).unwrap();
- }
-
- /// Shared code between handle_lock and handle_lock_ipc, does the actual syncing/flushing
- /// but the caller must send the response back
- fn handle_lock_sync(&mut self, context_id: WebGLContextId) -> (u32, Size2D<i32>, usize) {
let data =
Self::make_current_if_needed(context_id, &self.contexts, &mut self.bound_context_id)
.expect("WebGLContext not found in a WebGLMsg::Lock message");
@@ -374,7 +356,7 @@ impl WebGLThread {
data.ctx.gl().flush();
debug_assert!(data.ctx.gl().get_error() == gl::NO_ERROR);
- (info.texture_id, info.size, gl_sync as usize)
+ let _ = sender.send((info.texture_id, info.size, gl_sync as usize));
}
/// A version of locking that doesn't return a GLsync object,