Skip to content

Commit

Permalink
[tests] Add required audio stream snapshot tests (#851)
Browse files Browse the repository at this point in the history
  • Loading branch information
wkozyra95 committed Nov 12, 2024
1 parent a4186fe commit d24a018
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ fn fs_main(input: VertexOutput) -> @location(0) vec4<f32> {
rotation_degrees
);

let blur_alpha = smoothstep(0.0, blur_radius, edge_distance) * mask_alpha;
let blur_alpha = smoothstep(-blur_radius / 2.0, blur_radius / 2.0, edge_distance) * mask_alpha;

return vec4<f32>(color.rgb, color.a * blur_alpha);
}
Expand Down
13 changes: 6 additions & 7 deletions compositor_render/src/transformations/layout/flatten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,16 +346,15 @@ impl NestedLayout {
/// calculate RenderLayout for one of self box shadows
fn box_shadow_layout(&self, box_shadow: &BoxShadow, parent_masks: &[Mask]) -> RenderLayout {
RenderLayout {
top: self.top + box_shadow.offset_y - 0.5 * box_shadow.blur_radius,
left: self.left + box_shadow.offset_x - 0.5 * box_shadow.blur_radius,
width: self.width + box_shadow.blur_radius,
height: self.height + box_shadow.blur_radius,
top: self.top + box_shadow.offset_y,
left: self.left + box_shadow.offset_x,
width: self.width,
height: self.height,
rotation_degrees: self.rotation_degrees, // TODO: this is incorrect
border_radius: self.border_radius + box_shadow.blur_radius,
border_radius: self.border_radius + (box_shadow.blur_radius / 2.0),
content: RenderLayoutContent::BoxShadow {
color: box_shadow.color,
blur_radius: box_shadow.blur_radius * 2.0, // TODO: 2.0 is empirically selected
// value
blur_radius: box_shadow.blur_radius,
},
masks: parent_masks.to_vec(),
}
Expand Down
2 changes: 1 addition & 1 deletion snapshot_tests/snapshots
Submodule snapshots updated 20 files
+ render_snapshots/rescaler/border_radius_border_box_shadow_0_output_1.png
+ render_snapshots/rescaler/border_radius_border_box_shadow_rescaled_0_output_1.png
+ render_snapshots/rescaler/border_radius_box_shadow_0_output_1.png
+ render_snapshots/rescaler/border_radius_box_shadow_fill_input_stream_0_output_1.png
+ render_snapshots/rescaler/border_radius_box_shadow_fit_input_stream_0_output_1.png
+ render_snapshots/rescaler/box_shadow_0_output_1.png
+ render_snapshots/view/border_radius_border_box_shadow_0_output_1.png
+ render_snapshots/view/border_radius_border_box_shadow_rescaled_0_output_1.png
+ render_snapshots/view/border_radius_border_box_shadow_rescaled_and_hidden_by_parent_0_output_1.png
+ render_snapshots/view/border_radius_box_shadow_0_output_1.png
+ render_snapshots/view/border_radius_box_shadow_overflow_fit_0_output_1.png
+ render_snapshots/view/border_radius_box_shadow_overflow_hidden_0_output_1.png
+ render_snapshots/view/border_radius_box_shadow_rescaler_input_stream_0_output_1.png
+ render_snapshots/view/box_shadow_0_output_1.png
+ render_snapshots/view/box_shadow_sibling_0_output_1.png
+ rtp_packet_dumps/outputs/required_audio_inputs_no_offset_output.rtp
+ rtp_packet_dumps/outputs/required_audio_inputs_with_offset_missing_data_output.rtp
+ rtp_packet_dumps/outputs/required_audio_inputs_with_offset_output.rtp
+ rtp_packet_dumps/outputs/required_inputs_no_offset_output.rtp
+ rtp_packet_dumps/outputs/required_inputs_with_offset_output.rtp

0 comments on commit d24a018

Please sign in to comment.