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" path = "lib.rs"
[features] [features]
azure_backend = ["azure"] canvas2d-azure = ["azure"]
default = ["azure_backend"] canvas2d-raqote = ["raqote"]
default = ["canvas2d-azure"]
webgl_backtrace = ["canvas_traits/webgl_backtrace"] webgl_backtrace = ["canvas_traits/webgl_backtrace"]
raqote_backend = ["raqote"]
no_wgl = ["offscreen_gl_context/no_wgl"] no_wgl = ["offscreen_gl_context/no_wgl"]
[dependencies] [dependencies]

View file

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

View file

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

View file

@ -11,8 +11,8 @@ name = "constellation"
path = "lib.rs" path = "lib.rs"
[features] [features]
azure_backend = ["canvas/azure_backend"] canvas2d-azure = ["canvas/canvas2d-azure"]
raqote_backend = ["canvas/raqote_backend"] canvas2d-raqote = ["canvas/canvas2d-raqote"]
no_wgl = ["canvas/no_wgl"] no_wgl = ["canvas/no_wgl"]
[dependencies] [dependencies]

View file

@ -12,7 +12,8 @@ path = "lib.rs"
crate-type = ["rlib"] crate-type = ["rlib"]
[features] [features]
azure_backend = ["canvas/azure_backend"] canvas2d-azure = ["canvas/canvas2d-azure"]
canvas2d-raqote = ["canvas/canvas2d-raqote"]
debugmozjs = ["script/debugmozjs"] debugmozjs = ["script/debugmozjs"]
energy-profiling = ["profile_traits/energy-profiling"] energy-profiling = ["profile_traits/energy-profiling"]
profilemozjs = ["script/profilemozjs"] profilemozjs = ["script/profilemozjs"]
@ -21,7 +22,6 @@ js_backtrace = ["script/js_backtrace"]
max_log_level = ["log/release_max_level_info"] max_log_level = ["log/release_max_level_info"]
native-bluetooth = ["bluetooth/native-bluetooth"] native-bluetooth = ["bluetooth/native-bluetooth"]
no_wgl = ["canvas/no_wgl"] no_wgl = ["canvas/no_wgl"]
raqote_backend = ["canvas/raqote_backend"]
uwp = ["servo_config/uwp"] uwp = ["servo_config/uwp"]
webrender_debugger = ["webrender/debugger"] webrender_debugger = ["webrender/debugger"]
no_static_freetype = ["webrender/no_static_freetype"] no_static_freetype = ["webrender/no_static_freetype"]

View file

@ -183,7 +183,7 @@ def linux_tidy_unit_docs():
./mach build --dev ./mach build --dev
./mach test-unit ./mach test-unit
./mach package --dev ./mach package --dev
./mach build --dev --features raqote_backend ./mach build --dev --features canvas2d-raqote
./mach build --dev --libsimpleservo ./mach build --dev --libsimpleservo
./mach test-tidy --no-progress --self-test ./mach test-tidy --no-progress --self-test

View file

@ -27,7 +27,8 @@ OriginalFilename = "servo.exe"
ProductName = "Servo" ProductName = "Servo"
[features] [features]
azure_backend = ["libservo/azure_backend"] canvas2d-azure = ["libservo/canvas2d-azure"]
canvas2d-raqote = ["libservo/canvas2d-raqote"]
default = ["webdriver", "max_log_level"] default = ["webdriver", "max_log_level"]
energy-profiling = ["libservo/energy-profiling"] energy-profiling = ["libservo/energy-profiling"]
debugmozjs = ["libservo/debugmozjs"] debugmozjs = ["libservo/debugmozjs"]
@ -35,7 +36,6 @@ js_backtrace = ["libservo/js_backtrace"]
max_log_level = ["log/release_max_level_info"] max_log_level = ["log/release_max_level_info"]
native-bluetooth = ["libservo/native-bluetooth"] native-bluetooth = ["libservo/native-bluetooth"]
profilemozjs = ["libservo/profilemozjs"] profilemozjs = ["libservo/profilemozjs"]
raqote_backend = ["libservo/raqote_backend"]
webdriver = ["libservo/webdriver"] webdriver = ["libservo/webdriver"]
webgl_backtrace = ["libservo/webgl_backtrace"] webgl_backtrace = ["libservo/webgl_backtrace"]
webrender_debugger = ["libservo/webrender_debugger"] webrender_debugger = ["libservo/webrender_debugger"]

View file

@ -13,8 +13,8 @@ test = false
bench = false bench = false
[features] [features]
azure_backend = ["simpleservo/azure_backend"] canvas2d-azure = ["simpleservo/canvas2d-azure"]
raqote_backend = ["simpleservo/raqote_backend"] canvas2d-raqote = ["simpleservo/canvas2d-raqote"]
[dependencies] [dependencies]
libservo = { path = "../../components/servo", features = ["no_static_freetype"] } libservo = { path = "../../components/servo", features = ["no_static_freetype"] }

View file

@ -26,7 +26,8 @@ libloading = "0.5"
gl_generator = "0.11" gl_generator = "0.11"
[features] [features]
azure_backend = ["libservo/azure_backend"] canvas2d-azure = ["libservo/canvas2d-azure"]
canvas2d-raqote = ["libservo/canvas2d-raqote"]
default = ["webdriver", "max_log_level"] default = ["webdriver", "max_log_level"]
debugmozjs = ["libservo/debugmozjs"] debugmozjs = ["libservo/debugmozjs"]
energy-profiling = ["libservo/energy-profiling"] energy-profiling = ["libservo/energy-profiling"]
@ -37,7 +38,6 @@ native-bluetooth = ["libservo/native-bluetooth"]
no_static_freetype = ["libservo/no_static_freetype"] no_static_freetype = ["libservo/no_static_freetype"]
no_wgl = ["libservo/no_wgl"] no_wgl = ["libservo/no_wgl"]
oculusvr = ["libservo/oculusvr"] oculusvr = ["libservo/oculusvr"]
raqote_backend = ["libservo/raqote_backend"]
webdriver = ["libservo/webdriver"] webdriver = ["libservo/webdriver"]
uwp = ["libservo/uwp"] uwp = ["libservo/uwp"]
webgl_backtrace = ["libservo/webgl_backtrace"] webgl_backtrace = ["libservo/webgl_backtrace"]

View file

@ -21,7 +21,8 @@ env_logger = "0.6"
cbindgen = "0.8" cbindgen = "0.8"
[features] [features]
azure_backend = ["simpleservo/azure_backend"] canvas2d-azure = ["simpleservo/canvas2d-azure"]
canvas2d-raqote = ["simpleservo/canvas2d-raqote"]
debugmozjs = ["simpleservo/debugmozjs"] debugmozjs = ["simpleservo/debugmozjs"]
default = ["webdriver", "max_log_level"] default = ["webdriver", "max_log_level"]
energy-profiling = ["simpleservo/energy-profiling"] energy-profiling = ["simpleservo/energy-profiling"]
@ -31,7 +32,6 @@ max_log_level = ["simpleservo/max_log_level"]
native-bluetooth = ["simpleservo/native-bluetooth"] native-bluetooth = ["simpleservo/native-bluetooth"]
no_wgl = ["simpleservo/no_wgl"] no_wgl = ["simpleservo/no_wgl"]
oculusvr = ["simpleservo/oculusvr"] oculusvr = ["simpleservo/oculusvr"]
raqote_backend = ["simpleservo/raqote_backend"]
uwp = ["simpleservo/uwp"] uwp = ["simpleservo/uwp"]
webdriver = ["simpleservo/webdriver"] webdriver = ["simpleservo/webdriver"]
webgl_backtrace = ["simpleservo/webgl_backtrace"] webgl_backtrace = ["simpleservo/webgl_backtrace"]

View file

@ -26,7 +26,8 @@ simpleservo = { path = "../api" }
cc = "1.0" cc = "1.0"
[features] [features]
azure_backend = ["simpleservo/azure_backend"] canvas2d-azure = ["simpleservo/canvas2d-azure"]
canvas2d-raqote = ["simpleservo/canvas2d-raqote"]
debugmozjs = ["simpleservo/debugmozjs"] debugmozjs = ["simpleservo/debugmozjs"]
default = ["webdriver", "max_log_level"] default = ["webdriver", "max_log_level"]
energy-profiling = ["simpleservo/energy-profiling"] energy-profiling = ["simpleservo/energy-profiling"]
@ -35,6 +36,5 @@ js_backtrace = ["simpleservo/js_backtrace"]
max_log_level = ["simpleservo/max_log_level"] max_log_level = ["simpleservo/max_log_level"]
native-bluetooth = ["simpleservo/native-bluetooth"] native-bluetooth = ["simpleservo/native-bluetooth"]
oculusvr = ["simpleservo/oculusvr"] oculusvr = ["simpleservo/oculusvr"]
raqote_backend = ["simpleservo/raqote_backend"]
webdriver = ["simpleservo/webdriver"] webdriver = ["simpleservo/webdriver"]
webgl_backtrace = ["simpleservo/webgl_backtrace"] webgl_backtrace = ["simpleservo/webgl_backtrace"]

View file

@ -294,7 +294,7 @@ class MachCommands(CommandBase):
features += ["profilemozjs"] features += ["profilemozjs"]
if with_raqote: if with_raqote:
features += ["raqote_backend"] features += ["canvas2d-raqote"]
if without_wgl: if without_wgl:
features += ["no_wgl"] features += ["no_wgl"]
@ -304,8 +304,8 @@ class MachCommands(CommandBase):
if self.config["build"]["dom-backtrace"]: if self.config["build"]["dom-backtrace"]:
features += ["dom-backtrace"] features += ["dom-backtrace"]
if "raqote_backend" not in features: if "canvas2d-raqote" not in features:
features += ["azure_backend"] features += ["canvas2d-azure"]
if features: if features:
opts += ["--features", "%s" % ' '.join(features)] opts += ["--features", "%s" % ' '.join(features)]

View file

@ -264,7 +264,7 @@ class PostBuildCommands(CommandBase):
else: else:
copy2(full_name, destination) copy2(full_name, destination)
params += ["--features", "azure_backend"] params += ["--features", "canvas2d-azure"]
returncode = self.call_rustup_run( returncode = self.call_rustup_run(
["cargo", "doc", "--manifest-path", self.ports_glutin_manifest()] + params, ["cargo", "doc", "--manifest-path", self.ports_glutin_manifest()] + params,