Using the color helpers in CanvasPaintTask.

This commit is contained in:
Adenilson Cavalcanti 2015-02-05 16:27:15 -08:00
parent c360b75e16
commit a825e59516
4 changed files with 11 additions and 4 deletions

View file

@ -14,4 +14,7 @@ git = "https://github.com/servo/rust-azure"
git = "https://github.com/servo/rust-geom"
[dependencies.util]
path = "../util"
path = "../util"
[dependencies.gfx]
path = "../gfx"

View file

@ -2,10 +2,11 @@
* 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 azure::azure_hl::{DrawTarget, Color, SurfaceFormat, BackendType, StrokeOptions, DrawOptions};
use azure::azure_hl::{DrawTarget, SurfaceFormat, BackendType, StrokeOptions, DrawOptions};
use azure::azure_hl::{ColorPattern, PatternRef};
use geom::rect::Rect;
use geom::size::Size2D;
use gfx::color;
use util::task::spawn_named;
use std::borrow::ToOwned;
@ -32,8 +33,8 @@ impl CanvasPaintTask {
fn new(size: Size2D<i32>) -> CanvasPaintTask {
CanvasPaintTask {
drawtarget: CanvasPaintTask::create(size),
fill_color: ColorPattern::new(Color::new(0., 0., 0., 1.)),
stroke_color: ColorPattern::new(Color::new(0., 0., 0., 1.)),
fill_color: ColorPattern::new(color::black()),
stroke_color: ColorPattern::new(color::black()),
stroke_opts: StrokeOptions::new(1.0, 1.0),
}
}

View file

@ -9,6 +9,8 @@
extern crate azure;
extern crate geom;
extern crate gfx;
extern crate util;
pub mod canvas_paint_task;

View file

@ -53,6 +53,7 @@ version = "0.0.1"
dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1",
"util 0.0.1",
]