mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +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
|
@ -354,7 +354,7 @@ static void paint_separate_cell_borders(PaintableBox const& cell_box, HashMap<Ce
|
|||
.left = cell_box.box_model().border.left == 0 ? CSS::BorderData() : cell_box.computed_values().border_left(),
|
||||
};
|
||||
auto cell_rect = cell_coordinates_to_device_rect.get({ cell_box.table_cell_coordinates()->row_index, cell_box.table_cell_coordinates()->column_index }).value();
|
||||
paint_all_borders(context.display_list_recorder(), cell_rect, cell_box.normalized_border_radii_data().as_corners(context), borders_data.to_device_pixels(context));
|
||||
paint_all_borders(context.display_list_recorder(), cell_rect, cell_box.normalized_border_radii_data().as_corners(context.device_pixel_converter()), borders_data.to_device_pixels(context));
|
||||
}
|
||||
|
||||
void paint_table_borders(PaintContext& context, PaintableBox const& table_paintable)
|
||||
|
@ -428,10 +428,10 @@ void paint_table_borders(PaintContext& context, PaintableBox const& table_painta
|
|||
|
||||
for (auto const& cell_box : cell_boxes) {
|
||||
auto const& border_radii_data = cell_box.normalized_border_radii_data();
|
||||
auto top_left = border_radii_data.top_left.as_corner(context);
|
||||
auto top_right = border_radii_data.top_right.as_corner(context);
|
||||
auto bottom_right = border_radii_data.bottom_right.as_corner(context);
|
||||
auto bottom_left = border_radii_data.bottom_left.as_corner(context);
|
||||
auto top_left = border_radii_data.top_left.as_corner(context.device_pixel_converter());
|
||||
auto top_right = border_radii_data.top_right.as_corner(context.device_pixel_converter());
|
||||
auto bottom_right = border_radii_data.bottom_right.as_corner(context.device_pixel_converter());
|
||||
auto bottom_left = border_radii_data.bottom_left.as_corner(context.device_pixel_converter());
|
||||
if (!top_left && !top_right && !bottom_left && !bottom_right) {
|
||||
continue;
|
||||
} else {
|
||||
|
@ -441,7 +441,7 @@ void paint_table_borders(PaintContext& context, PaintableBox const& table_painta
|
|||
.bottom = cell_box.box_model().border.bottom == 0 ? CSS::BorderData() : cell_box.computed_values().border_bottom(),
|
||||
.left = cell_box.box_model().border.left == 0 ? CSS::BorderData() : cell_box.computed_values().border_left(),
|
||||
};
|
||||
paint_all_borders(context.display_list_recorder(), context.rounded_device_rect(cell_box.absolute_border_box_rect()), cell_box.normalized_border_radii_data().as_corners(context), borders_data.to_device_pixels(context));
|
||||
paint_all_borders(context.display_list_recorder(), context.rounded_device_rect(cell_box.absolute_border_box_rect()), cell_box.normalized_border_radii_data().as_corners(context.device_pixel_converter()), borders_data.to_device_pixels(context));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue