Skip to content

Commit

Permalink
[tests] Regenerate snapshot tests (no system fonts) (#848)
Browse files Browse the repository at this point in the history
  • Loading branch information
wkozyra95 authored Nov 4, 2024
1 parent 107cb80 commit 716d243
Show file tree
Hide file tree
Showing 19 changed files with 21 additions and 19 deletions.
Binary file added compositor_render/fonts/Inter_18pt-Bold.ttf
Binary file not shown.
5 changes: 5 additions & 0 deletions compositor_render/src/transformations/text_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ impl TextRendererCtx {
.load_font_source(Source::Binary(Arc::new(include_bytes!(
"../../fonts/Inter_18pt-Italic.ttf"
))));
font_system
.db_mut()
.load_font_source(Source::Binary(Arc::new(include_bytes!(
"../../fonts/Inter_18pt-Bold.ttf"
))));
Self {
font_system: Mutex::new(font_system),
swash_cache: Mutex::new(SwashCache::new()),
Expand Down
2 changes: 1 addition & 1 deletion snapshot_tests/snapshots
Submodule snapshots updated 93 files
+ render_snapshots/image/jpeg_as_root_0_output_1.png
+ render_snapshots/image/jpeg_in_view_overflow_fit_0_output_1.png
+ render_snapshots/rescaler/border_radius_box_shadow_0_output_1.png
+ render_snapshots/rescaler/fill_input_stream_higher_aspect_ratio_0_output_1.png
+ render_snapshots/rescaler/fill_input_stream_inverted_aspect_ratio_0_output_1.png
+ render_snapshots/rescaler/fill_input_stream_inverted_aspect_ratio_align_bottom_right_0_output_1.png
+ render_snapshots/rescaler/fill_input_stream_inverted_aspect_ratio_align_top_left_0_output_1.png
+ render_snapshots/rescaler/fill_input_stream_lower_aspect_ratio_0_output_1.png
+ render_snapshots/rescaler/fill_input_stream_lower_aspect_ratio_align_bottom_right_0_output_1.png
+ render_snapshots/rescaler/fill_input_stream_matching_aspect_ratio_0_output_1.png
+ render_snapshots/rescaler/fit_input_stream_higher_aspect_ratio_0_output_1.png
+ render_snapshots/rescaler/fit_input_stream_higher_aspect_ratio_small_resolution_0_output_1.png
+ render_snapshots/rescaler/fit_input_stream_inverted_aspect_ratio_0_output_1.png
+ render_snapshots/rescaler/fit_input_stream_inverted_aspect_ratio_align_bottom_right_0_output_1.png
+ render_snapshots/rescaler/fit_input_stream_inverted_aspect_ratio_align_top_left_0_output_1.png
+ render_snapshots/rescaler/fit_input_stream_lower_aspect_ratio_0_output_1.png
+ render_snapshots/rescaler/fit_input_stream_lower_aspect_ratio_align_bottom_right_0_output_1.png
+ render_snapshots/rescaler/fit_input_stream_matching_aspect_ratio_0_output_1.png
+ render_snapshots/rescaler/nested_border_width_radius_aligned_0_output_1.png
+ render_snapshots/shader/base_params_plane_id_5_inputs_0_output_1.png
+ render_snapshots/shader/base_params_time_0_output_1.png
+ render_snapshots/shader/user_params_circle_layout_0_output_1.png
+ render_snapshots/simple_input_pass_through_0_output_1.png
+ render_snapshots/text/align_center_0_output_1.png
+ render_snapshots/text/align_right_0_output_1.png
+ render_snapshots/text/bold_text_0_output_1.png
+ render_snapshots/text/dimensions_fitted_0_output_1.png
+ render_snapshots/text/dimensions_fitted_column_with_long_text_0_output_1.png
+ render_snapshots/text/dimensions_fitted_column_with_short_text_0_output_1.png
+ render_snapshots/text/dimensions_fixed_0_output_1.png
+ render_snapshots/text/dimensions_fixed_with_overflow_0_output_1.png
+ render_snapshots/text/red_text_on_blue_background_0_output_1.png
+ render_snapshots/text/text_as_root_0_output_1.png
+ render_snapshots/text/wrap_glyph_0_output_1.png
+ render_snapshots/text/wrap_none_0_output_1.png
+ render_snapshots/text/wrap_word_0_output_1.png
+ render_snapshots/tiles/01_inputs_0_output_1.png
+ render_snapshots/tiles/01_portrait_inputs_0_output_1.png
+ render_snapshots/tiles/01_portrait_inputs_on_portrait_output_0_output_1.png
+ render_snapshots/tiles/02_inputs_0_output_1.png
+ render_snapshots/tiles/02_portrait_inputs_0_output_1.png
+ render_snapshots/tiles/03_inputs_0_output_1.png
+ render_snapshots/tiles/03_inputs_on_portrait_output_0_output_1.png
+ render_snapshots/tiles/03_portrait_inputs_0_output_1.png
+ render_snapshots/tiles/03_portrait_inputs_on_portrait_output_0_output_1.png
+ render_snapshots/tiles/04_inputs_0_output_1.png
+ render_snapshots/tiles/05_inputs_0_output_1.png
+ render_snapshots/tiles/05_portrait_inputs_0_output_1.png
+ render_snapshots/tiles/05_portrait_inputs_on_portrait_output_0_output_1.png
+ render_snapshots/tiles/15_inputs_0_output_1.png
+ render_snapshots/tiles/15_portrait_inputs_0_output_1.png
+ render_snapshots/tiles/15_portrait_inputs_on_portrait_output_0_output_1.png
+ render_snapshots/tiles/align_center_with_03_inputs_0_output_1.png
+ render_snapshots/tiles/align_top_left_with_03_inputs_0_output_1.png
+ render_snapshots/tiles/align_with_margin_and_padding_with_03_inputs_0_output_1.png
+ render_snapshots/tiles/margin_and_padding_with_03_inputs_0_output_1.png
+ render_snapshots/tiles/margin_with_03_inputs_0_output_1.png
+ render_snapshots/tiles/padding_with_03_inputs_0_output_1.png
+ render_snapshots/tiles/video_call_with_labels_0_output_1.png
+ render_snapshots/tiles_transitions/add_2_inputs_at_the_end_to_3_tiles_scene_0_output_1.png
+ render_snapshots/tiles_transitions/add_2_inputs_at_the_end_to_3_tiles_scene_150_output_1.png
+ render_snapshots/tiles_transitions/add_2_inputs_at_the_end_to_3_tiles_scene_350_output_1.png
+ render_snapshots/tiles_transitions/add_2_inputs_at_the_end_to_3_tiles_scene_500_output_1.png
+ render_snapshots/tiles_transitions/add_input_at_the_end_to_3_tiles_scene_0_output_1.png
+ render_snapshots/tiles_transitions/add_input_at_the_end_to_3_tiles_scene_150_output_1.png
+ render_snapshots/tiles_transitions/add_input_at_the_end_to_3_tiles_scene_350_output_1.png
+ render_snapshots/tiles_transitions/add_input_at_the_end_to_3_tiles_scene_500_output_1.png
+ render_snapshots/tiles_transitions/add_input_on_2nd_pos_to_3_tiles_scene_0_output_1.png
+ render_snapshots/tiles_transitions/add_input_on_2nd_pos_to_3_tiles_scene_150_output_1.png
+ render_snapshots/tiles_transitions/add_input_on_2nd_pos_to_3_tiles_scene_350_output_1.png
+ render_snapshots/tiles_transitions/add_input_on_2nd_pos_to_3_tiles_scene_500_output_1.png
+ render_snapshots/tiles_transitions/change_order_of_3_inputs_with_id_0_output_1.png
+ render_snapshots/tiles_transitions/change_order_of_3_inputs_with_id_150_output_1.png
+ render_snapshots/tiles_transitions/change_order_of_3_inputs_with_id_350_output_1.png
+ render_snapshots/tiles_transitions/change_order_of_3_inputs_with_id_500_output_1.png
+ render_snapshots/tiles_transitions/replace_component_by_adding_id_0_output_1.png
+ render_snapshots/tiles_transitions/replace_component_by_adding_id_150_output_1.png
+ render_snapshots/tiles_transitions/replace_component_by_adding_id_350_output_1.png
+ render_snapshots/tiles_transitions/replace_component_by_adding_id_500_output_1.png
+ render_snapshots/tiles_transitions/tile_resize_entire_component_with_parent_transition_0_output_1.png
+ render_snapshots/tiles_transitions/tile_resize_entire_component_with_parent_transition_150_output_1.png
+ render_snapshots/tiles_transitions/tile_resize_entire_component_with_parent_transition_350_output_1.png
+ render_snapshots/tiles_transitions/tile_resize_entire_component_with_parent_transition_450_output_1.png
+ render_snapshots/tiles_transitions/tile_resize_entire_component_with_parent_transition_500_output_1.png
+ render_snapshots/tiles_transitions/tile_resize_entire_component_without_parent_transition_0_output_1.png
+ render_snapshots/tiles_transitions/tile_resize_entire_component_without_parent_transition_150_output_1.png
+ render_snapshots/tiles_transitions/tile_resize_entire_component_without_parent_transition_350_output_1.png
+ render_snapshots/tiles_transitions/tile_resize_entire_component_without_parent_transition_500_output_1.png
+ render_snapshots/view/constant_width_views_row_with_overflow_fit_0_output_1.png
+ render_snapshots/view/dynamic_width_views_row_0_output_1.png
+ render_snapshots/view/nested_border_width_radius_aligned_0_output_1.png
+ render_snapshots/view/nested_border_width_radius_multi_child_0_output_1.png
+ render_snapshots/view/overflow_hidden_with_input_stream_children_0_output_1.png
2 changes: 1 addition & 1 deletion snapshot_tests/text/align_center.scene.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "text",
"text": "Example text",
"font_size": 100,
"font_family": "Verdana",
"font_family": "Inter",
"align": "center",
"width": 1000,
"height": 200
Expand Down
2 changes: 1 addition & 1 deletion snapshot_tests/text/align_right.scene.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "text",
"text": "Example text",
"font_size": 100,
"font_family": "Verdana",
"font_family": "Inter",
"align": "right",
"width": 1000,
"height": 200
Expand Down
2 changes: 1 addition & 1 deletion snapshot_tests/text/bold_text.scene.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "text",
"text": "Example text",
"font_size": 100,
"font_family": "Verdana",
"font_family": "Inter",
"align": "right",
"weight": "bold",
"width": 1000,
Expand Down
2 changes: 1 addition & 1 deletion snapshot_tests/text/dimensions_fitted.scene.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "text",
"text": "Example text",
"font_size": 100,
"font_family": "Verdana",
"font_family": "Inter",
"background_color_rgba": "#FF0000FF"
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "text",
"text": "Example long text that should be longer that underlaying texture.",
"font_size": 30,
"font_family": "Verdana",
"font_family": "Inter",
"width": 300
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "text",
"text": "Example text",
"font_size": 30,
"font_family": "Verdana",
"font_family": "Inter",
"width": 300
}
]
Expand Down
2 changes: 1 addition & 1 deletion snapshot_tests/text/dimensions_fixed.scene.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "text",
"text": "Example text",
"font_size": 100,
"font_family": "Verdana",
"font_family": "Inter",
"width": 1000,
"height": 200
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "text",
"text": "Example text",
"font_size": 120,
"font_family": "Verdana",
"font_family": "Inter",
"width": 640,
"height": 80
}
Expand Down
2 changes: 1 addition & 1 deletion snapshot_tests/text/red_text_on_blue_background.scene.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "text",
"text": "Example text",
"font_size": 50,
"font_family": "Verdana",
"font_family": "Inter",
"align": "left",
"wrap": "word",
"color_rgba": "#FF0000FF",
Expand Down
2 changes: 1 addition & 1 deletion snapshot_tests/text/root_text.scene.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "text",
"text": "Example text",
"font_size": 100,
"font_family": "Verdana",
"font_family": "Inter",
"width": 1000,
"height": 200
}
Expand Down
2 changes: 1 addition & 1 deletion snapshot_tests/text/wrap_glyph.scene.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "text",
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum id eros non eros dictum scelerisque. Sed vehicula magna et metus fringilla, nec placerat felis elementum. Nullam tincidunt dui id purus egestas, et pulvinar est facilisis.",
"font_size": 50,
"font_family": "Verdana",
"font_family": "Inter",
"align": "left",
"wrap": "glyph",
"width": 1000,
Expand Down
2 changes: 1 addition & 1 deletion snapshot_tests/text/wrap_none.scene.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "text",
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum id eros non eros dictum scelerisque. Sed vehicula magna et metus fringilla, nec placerat felis elementum. Nullam tincidunt dui id purus egestas, et pulvinar est facilisis.",
"font_size": 50,
"font_family": "Verdana",
"font_family": "Inter",
"align": "left",
"wrap": "none",
"width": 1000,
Expand Down
2 changes: 1 addition & 1 deletion snapshot_tests/text/wrap_word.scene.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "text",
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum id eros non eros dictum scelerisque. Sed vehicula magna et metus fringilla, nec placerat felis elementum. Nullam tincidunt dui id purus egestas, et pulvinar est facilisis.",
"font_size": 50,
"font_family": "Verdana",
"font_family": "Inter",
"align": "left",
"wrap": "word",
"width": 1000,
Expand Down
2 changes: 1 addition & 1 deletion src/snapshot_tests/test_case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl Default for TestCase {
timestamps: vec![Duration::from_secs(0)],
scene_updates: Updates::Scenes(vec![]),
only: false,
allowed_error: 20.0,
allowed_error: 1.0,
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/snapshot_tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,6 @@ fn text_snapshot_tests() -> Vec<TestCase> {
include_str!("../../snapshot_tests/text/wrap_glyph.scene.json"),
DEFAULT_RESOLUTION,
),
allowed_error: 325.7,
..Default::default()
},
TestCase {
Expand All @@ -1205,7 +1204,6 @@ fn text_snapshot_tests() -> Vec<TestCase> {
include_str!("../../snapshot_tests/text/wrap_word.scene.json"),
DEFAULT_RESOLUTION,
),
allowed_error: 321.8,
..Default::default()
},
TestCase {
Expand Down Expand Up @@ -1722,7 +1720,6 @@ fn view_snapshot_tests() -> Vec<TestCase> {
},
TestCase {
name: "view/border_radius_box_shadow_overflow_fit",
only: true,
scene_updates: Updates::Scene(
include_str!("../../snapshot_tests/view/border_radius_box_shadow_overflow_fit.scene.json"),
DEFAULT_RESOLUTION,
Expand Down
2 changes: 1 addition & 1 deletion src/snapshot_tests/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub(super) fn create_renderer() -> Renderer {
stream_fallback_timeout: Duration::from_secs(3),
wgpu_features: WgpuFeatures::default(),
wgpu_ctx: Some(global_wgpu_ctx(false, Default::default())),
load_system_fonts: true,
load_system_fonts: false,
})
.unwrap();
renderer
Expand Down

0 comments on commit 716d243

Please sign in to comment.