зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
417ed499f1
Коммит
5ef90cabc3
|
@ -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
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче