Rename {azure,raqote}_backend feature flags to canvas2d-{azure,raqote}

This commit is contained in:
Simon Sapin 2019-07-01 15:23:11 +02:00
parent bddfe9a468
commit 1df2605292
13 changed files with 50 additions and 50 deletions

View file

@ -11,10 +11,10 @@ name = "canvas"
path = "lib.rs"
[features]
azure_backend = ["azure"]
default = ["azure_backend"]
canvas2d-azure = ["azure"]
canvas2d-raqote = ["raqote"]
default = ["canvas2d-azure"]
webgl_backtrace = ["canvas_traits/webgl_backtrace"]
raqote_backend = ["raqote"]
no_wgl = ["offscreen_gl_context/no_wgl"]
[dependencies]

View file

@ -281,92 +281,92 @@ pub trait GenericDrawTarget {
#[derive(Clone)]
pub enum ExtendMode {
#[cfg(feature = "azure_backend")]
#[cfg(feature = "canvas2d-azure")]
Azure(azure::azure_hl::ExtendMode),
#[cfg(feature = "raqote_backend")]
#[cfg(feature = "canvas2d-raqote")]
Raqote(()),
}
pub enum GradientStop {
#[cfg(feature = "azure_backend")]
#[cfg(feature = "canvas2d-azure")]
Azure(azure::AzGradientStop),
#[cfg(feature = "raqote_backend")]
#[cfg(feature = "canvas2d-raqote")]
Raqote(()),
}
pub enum GradientStops {
#[cfg(feature = "azure_backend")]
#[cfg(feature = "canvas2d-azure")]
Azure(azure::azure_hl::GradientStops),
#[cfg(feature = "raqote_backend")]
#[cfg(feature = "canvas2d-raqote")]
Raqote(()),
}
#[derive(Clone)]
pub enum Color {
#[cfg(feature = "azure_backend")]
#[cfg(feature = "canvas2d-azure")]
Azure(azure::azure_hl::Color),
#[cfg(feature = "raqote_backend")]
#[cfg(feature = "canvas2d-raqote")]
Raqote(()),
}
#[derive(Clone)]
pub enum CompositionOp {
#[cfg(feature = "azure_backend")]
#[cfg(feature = "canvas2d-azure")]
Azure(azure::azure_hl::CompositionOp),
#[cfg(feature = "raqote_backend")]
#[cfg(feature = "canvas2d-raqote")]
Raqote(()),
}
pub enum SurfaceFormat {
#[cfg(feature = "azure_backend")]
#[cfg(feature = "canvas2d-azure")]
Azure(azure::azure_hl::SurfaceFormat),
#[cfg(feature = "raqote_backend")]
#[cfg(feature = "canvas2d-raqote")]
Raqote(()),
}
#[derive(Clone)]
pub enum SourceSurface {
#[cfg(feature = "azure_backend")]
#[cfg(feature = "canvas2d-azure")]
Azure(azure::azure_hl::SourceSurface),
#[cfg(feature = "raqote_backend")]
#[cfg(feature = "canvas2d-raqote")]
Raqote(()),
}
pub enum Path {
#[cfg(feature = "azure_backend")]
#[cfg(feature = "canvas2d-azure")]
Azure(azure::azure_hl::Path),
#[cfg(feature = "raqote_backend")]
#[cfg(feature = "canvas2d-raqote")]
Raqote(()),
}
#[derive(Clone)]
pub enum Pattern {
#[cfg(feature = "azure_backend")]
#[cfg(feature = "canvas2d-azure")]
Azure(azure::azure_hl::Pattern),
#[cfg(feature = "raqote_backend")]
#[cfg(feature = "canvas2d-raqote")]
Raqote(()),
}
pub enum DrawSurfaceOptions {
#[cfg(feature = "azure_backend")]
#[cfg(feature = "canvas2d-azure")]
Azure(azure::azure_hl::DrawSurfaceOptions),
#[cfg(feature = "raqote_backend")]
#[cfg(feature = "canvas2d-raqote")]
Raqote(()),
}
#[derive(Clone)]
pub enum DrawOptions {
#[cfg(feature = "azure_backend")]
#[cfg(feature = "canvas2d-azure")]
Azure(azure::azure_hl::DrawOptions),
#[cfg(feature = "raqote_backend")]
#[cfg(feature = "canvas2d-raqote")]
Raqote(()),
}
#[derive(Clone)]
pub enum StrokeOptions<'a> {
#[cfg(feature = "azure_backend")]
#[cfg(feature = "canvas2d-azure")]
Azure(azure::azure_hl::StrokeOptions<'a>),
#[cfg(feature = "raqote_backend")]
#[cfg(feature = "canvas2d-raqote")]
Raqote(PhantomData<&'a ()>),
}
@ -391,12 +391,12 @@ pub struct CanvasData<'a> {
pub canvas_id: CanvasId,
}
#[cfg(feature = "azure_backend")]
#[cfg(feature = "canvas2d-azure")]
fn create_backend() -> Box<dyn Backend> {
Box::new(crate::azure_backend::AzureBackend)
}
#[cfg(feature = "raqote_backend")]
#[cfg(feature = "canvas2d-raqote")]
fn create_backend() -> Box<dyn Backend> {
Box::new(crate::raqote_backend::RaqoteBackend)
}

View file

@ -7,10 +7,10 @@
#[macro_use]
extern crate log;
#[cfg(feature = "azure_backend")]
#[cfg(feature = "canvas2d-azure")]
mod azure_backend;
#[cfg(feature = "raqote_backend")]
#[cfg(feature = "canvas2d-raqote")]
mod raqote_backend;
pub mod canvas_data;