mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Using the color helpers in CanvasPaintTask.
This commit is contained in:
parent
c360b75e16
commit
a825e59516
4 changed files with 11 additions and 4 deletions
|
@ -14,4 +14,7 @@ git = "https://github.com/servo/rust-azure"
|
||||||
git = "https://github.com/servo/rust-geom"
|
git = "https://github.com/servo/rust-geom"
|
||||||
|
|
||||||
[dependencies.util]
|
[dependencies.util]
|
||||||
path = "../util"
|
path = "../util"
|
||||||
|
|
||||||
|
[dependencies.gfx]
|
||||||
|
path = "../gfx"
|
||||||
|
|
|
@ -2,10 +2,11 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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 azure::azure_hl::{ColorPattern, PatternRef};
|
||||||
use geom::rect::Rect;
|
use geom::rect::Rect;
|
||||||
use geom::size::Size2D;
|
use geom::size::Size2D;
|
||||||
|
use gfx::color;
|
||||||
use util::task::spawn_named;
|
use util::task::spawn_named;
|
||||||
|
|
||||||
use std::borrow::ToOwned;
|
use std::borrow::ToOwned;
|
||||||
|
@ -32,8 +33,8 @@ impl CanvasPaintTask {
|
||||||
fn new(size: Size2D<i32>) -> CanvasPaintTask {
|
fn new(size: Size2D<i32>) -> CanvasPaintTask {
|
||||||
CanvasPaintTask {
|
CanvasPaintTask {
|
||||||
drawtarget: CanvasPaintTask::create(size),
|
drawtarget: CanvasPaintTask::create(size),
|
||||||
fill_color: ColorPattern::new(Color::new(0., 0., 0., 1.)),
|
fill_color: ColorPattern::new(color::black()),
|
||||||
stroke_color: ColorPattern::new(Color::new(0., 0., 0., 1.)),
|
stroke_color: ColorPattern::new(color::black()),
|
||||||
stroke_opts: StrokeOptions::new(1.0, 1.0),
|
stroke_opts: StrokeOptions::new(1.0, 1.0),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
extern crate azure;
|
extern crate azure;
|
||||||
extern crate geom;
|
extern crate geom;
|
||||||
|
extern crate gfx;
|
||||||
extern crate util;
|
extern crate util;
|
||||||
|
|
||||||
|
|
||||||
pub mod canvas_paint_task;
|
pub mod canvas_paint_task;
|
||||||
|
|
1
components/servo/Cargo.lock
generated
1
components/servo/Cargo.lock
generated
|
@ -53,6 +53,7 @@ version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
|
"azure 0.1.0 (git+https://github.com/servo/rust-azure)",
|
||||||
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
|
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
|
||||||
|
"gfx 0.0.1",
|
||||||
"util 0.0.1",
|
"util 0.0.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue