mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Improve WebGL architecture.
This commit is contained in:
parent
e9cbbc58cc
commit
703962fe61
54 changed files with 3154 additions and 1426 deletions
|
@ -2,10 +2,10 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use canvas_traits::{Canvas2dMsg, CanvasCommonMsg, CanvasMsg};
|
||||
use canvas_traits::{CompositionOrBlending, FillOrStrokeStyle, FillRule};
|
||||
use canvas_traits::{LineCapStyle, LineJoinStyle, LinearGradientStyle};
|
||||
use canvas_traits::{RadialGradientStyle, RepetitionStyle, byte_swap_and_premultiply};
|
||||
use canvas_traits::canvas::{Canvas2dMsg, CanvasMsg};
|
||||
use canvas_traits::canvas::{CompositionOrBlending, FillOrStrokeStyle, FillRule};
|
||||
use canvas_traits::canvas::{LineCapStyle, LineJoinStyle, LinearGradientStyle};
|
||||
use canvas_traits::canvas::{RadialGradientStyle, RepetitionStyle, byte_swap_and_premultiply};
|
||||
use cssparser::{Parser, ParserInput, RGBA};
|
||||
use cssparser::Color as CSSColor;
|
||||
use dom::bindings::cell::DOMRefCell;
|
||||
|
@ -163,7 +163,7 @@ impl CanvasRenderingContext2D {
|
|||
pub fn set_bitmap_dimensions(&self, size: Size2D<i32>) {
|
||||
self.reset_to_initial_state();
|
||||
self.ipc_renderer
|
||||
.send(CanvasMsg::Common(CanvasCommonMsg::Recreate(size)))
|
||||
.send(CanvasMsg::Recreate(size))
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
|
@ -173,10 +173,6 @@ impl CanvasRenderingContext2D {
|
|||
*self.state.borrow_mut() = CanvasContextState::new();
|
||||
}
|
||||
|
||||
pub fn ipc_renderer(&self) -> IpcSender<CanvasMsg> {
|
||||
self.ipc_renderer.clone()
|
||||
}
|
||||
|
||||
fn mark_as_dirty(&self) {
|
||||
if let Some(ref canvas) = self.canvas {
|
||||
canvas.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
|
||||
|
@ -1392,7 +1388,7 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
|
|||
|
||||
impl Drop for CanvasRenderingContext2D {
|
||||
fn drop(&mut self) {
|
||||
if let Err(err) = self.ipc_renderer.send(CanvasMsg::Common(CanvasCommonMsg::Close)) {
|
||||
if let Err(err) = self.ipc_renderer.send(CanvasMsg::Close) {
|
||||
warn!("Could not close canvas: {}", err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue