mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Cleanup WebGLRenderingContext, Websocker, WorkerGlobalScope
This commit is contained in:
parent
5c4f91c0f1
commit
a53b86f107
3 changed files with 9 additions and 11 deletions
|
@ -514,15 +514,13 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
|
|||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||
fn VertexAttribPointer(self, attrib_id: u32, size: i32, data_type: u32,
|
||||
normalized: bool, stride: i32, offset: i64) {
|
||||
match data_type {
|
||||
constants::FLOAT => {
|
||||
if let constants::FLOAT = data_type {
|
||||
let msg = CanvasMsg::WebGL(
|
||||
CanvasWebGLMsg::VertexAttribPointer2f(attrib_id, size, normalized, stride, offset));
|
||||
self.ipc_renderer.send(msg).unwrap()
|
||||
} else {
|
||||
panic!("VertexAttribPointer: Data Type not supported")
|
||||
}
|
||||
_ => panic!("VertexAttribPointer: Data Type not supported")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.4
|
||||
|
|
|
@ -277,7 +277,7 @@ impl<'a> WebSocketMethods for &'a WebSocket {
|
|||
let mut other_sender = self.sender.borrow_mut();
|
||||
let my_sender = other_sender.as_mut().unwrap();
|
||||
let _ = my_sender.lock().unwrap().send_message(Message::Text(data.unwrap().0));
|
||||
return Ok(())
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-websocket-close
|
||||
|
|
|
@ -143,11 +143,11 @@ impl WorkerGlobalScope {
|
|||
self.runtime.cx()
|
||||
}
|
||||
|
||||
pub fn resource_task<'a>(&'a self) -> &'a ResourceTask {
|
||||
pub fn resource_task(&self) -> &ResourceTask {
|
||||
&self.resource_task
|
||||
}
|
||||
|
||||
pub fn get_url<'a>(&'a self) -> &'a Url {
|
||||
pub fn get_url(&self) -> &Url {
|
||||
&self.worker_url
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue