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;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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