mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Run all task spawning through util, to allow for easy hooking.
During debugging, I found it useful to hook all task creation in a central location, and util::task was the perfect place for it. r? @pcwalton (or maybe someone else, I'm kinda sending you a bunch of reviews today because I don't know who better to give them to)
This commit is contained in:
parent
9e94ecf99c
commit
6df1cc8e4c
14 changed files with 48 additions and 36 deletions
|
@ -6,9 +6,9 @@ use azure::azure_hl::{DrawTarget, Color, B8G8R8A8, SkiaBackend, StrokeOptions, D
|
|||
use azure::azure_hl::{ColorPattern, ColorPatternRef};
|
||||
use geom::rect::Rect;
|
||||
use geom::size::Size2D;
|
||||
use servo_util::task::spawn_named;
|
||||
|
||||
use std::comm;
|
||||
use std::task::TaskBuilder;
|
||||
|
||||
pub enum CanvasMsg {
|
||||
FillRect(Rect<f32>),
|
||||
|
@ -37,8 +37,7 @@ impl CanvasRenderTask {
|
|||
|
||||
pub fn start(size: Size2D<i32>) -> Sender<CanvasMsg> {
|
||||
let (chan, port) = comm::channel::<CanvasMsg>();
|
||||
let builder = TaskBuilder::new().named("CanvasTask");
|
||||
builder.spawn(proc() {
|
||||
spawn_named("CanvasTask", proc() {
|
||||
let mut renderer = CanvasRenderTask::new(size);
|
||||
|
||||
loop {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue