mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Remove HTMLCanvasData::renderer_id.
This commit is contained in:
parent
1c1e55792f
commit
036b789377
1 changed files with 10 additions and 13 deletions
|
@ -94,7 +94,6 @@ impl HTMLCanvasElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct HTMLCanvasData {
|
pub struct HTMLCanvasData {
|
||||||
pub renderer_id: Option<usize>,
|
|
||||||
pub ipc_renderer: Option<IpcSender<CanvasMsg>>,
|
pub ipc_renderer: Option<IpcSender<CanvasMsg>>,
|
||||||
pub width: u32,
|
pub width: u32,
|
||||||
pub height: u32,
|
pub height: u32,
|
||||||
|
@ -109,22 +108,20 @@ impl LayoutHTMLCanvasElementHelpers for LayoutJS<HTMLCanvasElement> {
|
||||||
fn data(&self) -> HTMLCanvasData {
|
fn data(&self) -> HTMLCanvasData {
|
||||||
unsafe {
|
unsafe {
|
||||||
let canvas = &*self.unsafe_get();
|
let canvas = &*self.unsafe_get();
|
||||||
let (renderer_id, ipc_renderer) = match canvas.context.borrow_for_layout().as_ref() {
|
let ipc_renderer = canvas.context.borrow_for_layout().as_ref().map(|context| {
|
||||||
Some(&CanvasContext::Context2d(ref context)) => {
|
match *context {
|
||||||
let context = context.to_layout();
|
CanvasContext::Context2d(ref context) => {
|
||||||
(Some(context.get_renderer_id()), Some(context.get_ipc_renderer()))
|
context.to_layout().get_ipc_renderer()
|
||||||
},
|
},
|
||||||
Some(&CanvasContext::WebGL(ref context)) => {
|
CanvasContext::WebGL(ref context) => {
|
||||||
let context = context.to_layout();
|
context.to_layout().get_ipc_renderer()
|
||||||
(Some(context.get_renderer_id()), Some(context.get_ipc_renderer()))
|
|
||||||
},
|
},
|
||||||
None => (None, None),
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
let width_attr = canvas.upcast::<Element>().get_attr_for_layout(&ns!(), &atom!("width"));
|
let width_attr = canvas.upcast::<Element>().get_attr_for_layout(&ns!(), &atom!("width"));
|
||||||
let height_attr = canvas.upcast::<Element>().get_attr_for_layout(&ns!(), &atom!("height"));
|
let height_attr = canvas.upcast::<Element>().get_attr_for_layout(&ns!(), &atom!("height"));
|
||||||
HTMLCanvasData {
|
HTMLCanvasData {
|
||||||
renderer_id: renderer_id,
|
|
||||||
ipc_renderer: ipc_renderer,
|
ipc_renderer: ipc_renderer,
|
||||||
width: width_attr.map_or(DEFAULT_WIDTH, |val| val.as_uint()),
|
width: width_attr.map_or(DEFAULT_WIDTH, |val| val.as_uint()),
|
||||||
height: height_attr.map_or(DEFAULT_HEIGHT, |val| val.as_uint()),
|
height: height_attr.map_or(DEFAULT_HEIGHT, |val| val.as_uint()),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue