Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Sep 12, 2024
1 parent 2b45e7b commit 6c5b134
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 18 deletions.
2 changes: 2 additions & 0 deletions crates/eframe/src/web/app_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ impl AppRunner {
ime,
#[cfg(feature = "accesskit")]
accesskit_update: _, // not currently implemented
num_completed_passes: _, // handled by `Context::run`
requested_discard: _, // handled by `Context::run`
} = platform_output;

super::set_cursor_icon(cursor_icon);
Expand Down
19 changes: 8 additions & 11 deletions crates/egui/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1632,17 +1632,14 @@ impl Context {
self.output_mut(|o| o.requested_discard = true);

#[cfg(feature = "log")]
{
// TODO: trace level?
log::debug!(
"request_discard: {}",
if self.will_discard() {
"allowed"
} else {
"denied"
}
);
}
log::trace!(
"request_discard: {}",
if self.will_discard() {
"allowed"
} else {
"denied"
}
);
}

/// Will the visual output of this frame be discarded?
Expand Down
4 changes: 2 additions & 2 deletions crates/egui/src/data/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ pub struct PlatformOutput {

/// How many ui passes is this the sum of?
///
/// See [`Context::request_discard`] for details.
/// See [`crate::Context::request_discard`] for details.
///
/// This is incremented at the END of each frame,
/// so this will be `0` for the first pass.
pub num_completed_passes: usize,

/// Was [`Context::request_discard`] called during the latest pass?
/// Was [`crate::Context::request_discard`] called during the latest pass?
pub requested_discard: bool,
}

Expand Down
6 changes: 3 additions & 3 deletions crates/egui/src/memory/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ pub struct Options {
///
/// egui will usually only ever run one pass, even if `max_passes` is large.
///
/// If this is `1`, [`Context::request_discard`] will be ignored.
/// If this is `1`, [`crate::Context::request_discard`] will be ignored.
///
/// Multi-pass is supported by [`Context::run`].
/// Multi-pass is supported by [`crate::Context::run`].
///
/// See [`Context::request_discard`] for more.
/// See [`crate::Context::request_discard`] for more.
pub max_passes: NonZeroUsize,

/// This is a signal to any backend that we want the [`crate::PlatformOutput::events`] read out loud.
Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1462,8 +1462,8 @@ impl Ui {
/// See also [`Self::add`] and [`Self::put`].
///
/// ```
/// # let mut my_value = 42;
/// # egui::__run_test_ui(|ui| {
/// # let mut my_value = 42;
/// ui.add_sized([40.0, 20.0], egui::DragValue::new(&mut my_value));
/// # });
/// ```
Expand Down
8 changes: 7 additions & 1 deletion crates/egui_demo_app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ fn main() -> eframe::Result {

{
// Silence wgpu log spam (https://github.com/gfx-rs/wgpu/issues/3206)
let mut rust_log = std::env::var("RUST_LOG").unwrap_or_else(|_| "info".to_owned());
let mut rust_log = std::env::var("RUST_LOG").unwrap_or_else(|_| {
if cfg!(debug_assertions) {
"debug".to_owned()
} else {
"info".to_owned()
}
});
for loud_crate in ["naga", "wgpu_core", "wgpu_hal"] {
if !rust_log.contains(&format!("{loud_crate}=")) {
rust_log += &format!(",{loud_crate}=warn");
Expand Down

0 comments on commit 6c5b134

Please sign in to comment.