mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Separate device pixel conversion helpers from PaintContext
In the upcoming change, device pixel conversion of ClipFrame will happen during display list replay, where PaintContext is not available, so let’s move it out of PaintContext.
This commit is contained in:
parent
4c88c7445c
commit
7e333cdcf7
Notes:
github-actions[bot]
2025-07-14 13:49:44 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 7e333cdcf7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5431
Reviewed-by: https://github.com/gmta ✅
Reviewed-by: https://github.com/konradekk
12 changed files with 150 additions and 74 deletions
|
@ -62,7 +62,7 @@ void FieldSetPaintable::paint(PaintContext& context, PaintPhase phase) const
|
|||
.left = box_model().border.left == 0 ? CSS::BorderData() : computed_values().border_left(),
|
||||
};
|
||||
|
||||
paint_all_borders(display_list_recorder, fieldset_border_rect, normalized_border_radii_data().as_corners(context), borders_data.to_device_pixels(context));
|
||||
paint_all_borders(display_list_recorder, fieldset_border_rect, normalized_border_radii_data().as_corners(context.device_pixel_converter()), borders_data.to_device_pixels(context));
|
||||
|
||||
auto top_border_data = box_model().border.top == 0 ? CSS::BorderData() : computed_values().border_top();
|
||||
auto top_border = context.enclosing_device_pixels(top_border_data.width).value();
|
||||
|
@ -92,7 +92,7 @@ void FieldSetPaintable::paint(PaintContext& context, PaintPhase phase) const
|
|||
|
||||
display_list_recorder.save();
|
||||
display_list_recorder.add_clip_rect(left_segment.to_type<int>());
|
||||
paint_all_borders(display_list_recorder, fieldset_border_rect, normalized_border_radii_data().as_corners(context), top_border_only.to_device_pixels(context));
|
||||
paint_all_borders(display_list_recorder, fieldset_border_rect, normalized_border_radii_data().as_corners(context.device_pixel_converter()), top_border_only.to_device_pixels(context));
|
||||
display_list_recorder.restore();
|
||||
|
||||
display_list_recorder.save();
|
||||
|
@ -100,7 +100,7 @@ void FieldSetPaintable::paint(PaintContext& context, PaintPhase phase) const
|
|||
paint_all_borders(
|
||||
display_list_recorder,
|
||||
fieldset_border_rect,
|
||||
normalized_border_radii_data().as_corners(context),
|
||||
normalized_border_radii_data().as_corners(context.device_pixel_converter()),
|
||||
top_border_only.to_device_pixels(context));
|
||||
display_list_recorder.restore();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue