Skip to content

Commit

Permalink
Update screenshots for rendering without antialiasing, optimistically…
Browse files Browse the repository at this point in the history
… assume all pixels are sameish now
  • Loading branch information
Wumpf committed Feb 7, 2025
1 parent 9b477ce commit 7e33a4a
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 33 deletions.
12 changes: 2 additions & 10 deletions crates/viewer/re_view_spatial/tests/draw_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ pub fn test_draw_order() {
&mut test_context,
view_id,
"draw_order",
// TODO(#8924): A lot of pixels won't pass the diff because of anti-aliasing.
// By bumping the resolution, we lessen the weight of edges.
egui::vec2(300.0, 150.0) * 4.0,
egui::vec2(300.0, 150.0) * 2.0,
);
}

Expand Down Expand Up @@ -211,11 +209,5 @@ fn run_view_ui_and_save_snapshot(
});

harness.run();

// TODO(#8924): To account for platform-specific AA.
let broken_percent_threshold = 0.003;
let num_pixels = (size.x * size.y).ceil() as u64;

use re_viewer_context::test_context::HarnessExt as _;
harness.snapshot_with_broken_pixels_threshold(name, num_pixels, broken_percent_threshold);
harness.snapshot(name);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions crates/viewer/re_view_spatial/tests/snapshots/draw_order.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 2 additions & 14 deletions crates/viewer/re_view_spatial/tests/transform_clamping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ pub fn test_transform_clamping() {
&mut test_context,
view_ids,
"transform_clamping",
// TODO(#8924): A lot of pixels won't pass the diff because of anti-aliasing.
// By bumping the resolution, we lessen the weight of edges.
egui::vec2(300.0, 300.0) * 3.0,
egui::vec2(300.0, 300.0),
);
}

Expand Down Expand Up @@ -252,17 +250,7 @@ fn run_view_ui_and_save_snapshot(
modifiers: egui::Modifiers::default(),
});
harness.run_steps(10);

// TODO(#8924): To account for platform-specific AA.
let broken_percent_threshold = 0.007;
let num_pixels = (size.x * size.y).ceil() as u64;

use re_viewer_context::test_context::HarnessExt as _;
harness.snapshot_with_broken_pixels_threshold(
&name,
num_pixels,
broken_percent_threshold,
);
harness.snapshot(&name);
}
}
}
2 changes: 1 addition & 1 deletion crates/viewer/re_viewer_context/src/test_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl HarnessExt for egui_kittest::Harness<'_> {
/// Example:
/// ```rust
/// use re_viewer_context::test_context::TestContext;
/// use re_viewer_context::ViewerContext;1
/// use re_viewer_context::ViewerContext;
///
/// let mut test_context = TestContext::default();
/// test_context.run_in_egui_central_panel(|ctx: &ViewerContext, _| {
Expand Down

0 comments on commit 7e33a4a

Please sign in to comment.