Add snapshot test for image blending (#7309)

This adds a test that can be used to see the improvements made by this
PR (if any):
* https://github.com/emilk/egui/pull/5839
This commit is contained in:
Emil Ernerfeldt 2025-07-07 13:58:22 +02:00 committed by GitHub
parent 09596a5e7b
commit dd1052108e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 31 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

View File

@ -0,0 +1,25 @@
use egui::{hex_color, include_image};
use egui_kittest::Harness;
#[test]
fn test_image_blending() {
for pixels_per_point in [1.0, 2.0] {
let mut harness = Harness::builder()
.with_pixels_per_point(pixels_per_point)
.build_ui(|ui| {
egui_extras::install_image_loaders(ui.ctx());
egui::Frame::new()
.fill(hex_color!("#5981FF"))
.show(ui, |ui| {
ui.add(
egui::Image::new(include_image!("../data/ring.png"))
.max_height(18.0)
.tint(egui::Color32::GRAY),
);
});
});
harness.run();
harness.fit_contents();
harness.snapshot(format!("image_blending/image_x{pixels_per_point}"));
}
}

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ae04cea447427982f1d68bb2250563aaa3be137a77f6dd3f253da77c194c84cf
size 812

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ff053e309e6ae38a4b6fe1dd58f1255116fffab6182ce5f77b6360b00cf2af47
size 2067