Bug 1678711 - Make running with --software without the "software" feature panic. r=lsalzman

I think this is more helpful than silently failing.

Differential Revision: https://phabricator.services.mozilla.com/D97804
This commit is contained in:
Jeff Muizelaar 2020-11-27 14:51:19 +00:00
Родитель 417ed499f1
Коммит 5ef90cabc3
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -305,15 +305,15 @@ impl WindowWrapper {
}
#[cfg(feature = "software")]
fn make_software_context() -> Option<swgl::Context> {
fn make_software_context() -> swgl::Context {
let ctx = swgl::Context::create();
ctx.make_current();
Some(ctx)
ctx
}
#[cfg(not(feature = "software"))]
fn make_software_context() -> Option<swgl::Context> {
None
fn make_software_context() -> swgl::Context {
panic!("software feature not enabled")
}
fn make_window(
@ -326,7 +326,7 @@ fn make_window(
software: bool,
) -> WindowWrapper {
let sw_ctx = if software {
make_software_context()
Some(make_software_context())
} else {
None
};