mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:07:36 +00:00
LibWeb: Add basic support for borders painting in GPU executor
For now all borders are painted without rounded corners.
This commit is contained in:
parent
29ff1f67be
commit
9888db1c27
1 changed files with 32 additions and 3 deletions
|
@ -222,10 +222,39 @@ CommandResult PaintingCommandExecutorGPU::blit_corner_clipping(BorderRadiusCorne
|
||||||
|
|
||||||
CommandResult PaintingCommandExecutorGPU::paint_borders(DevicePixelRect const& border_rect, CornerRadii const& corner_radii, BordersDataDevicePixels const& borders_data)
|
CommandResult PaintingCommandExecutorGPU::paint_borders(DevicePixelRect const& border_rect, CornerRadii const& corner_radii, BordersDataDevicePixels const& borders_data)
|
||||||
{
|
{
|
||||||
// FIXME
|
// FIXME: Add support for corner radiuses
|
||||||
(void)border_rect;
|
|
||||||
(void)corner_radii;
|
(void)corner_radii;
|
||||||
(void)borders_data;
|
|
||||||
|
Gfx::IntRect top_border_rect = {
|
||||||
|
border_rect.x(),
|
||||||
|
border_rect.y(),
|
||||||
|
border_rect.width(),
|
||||||
|
borders_data.top.width
|
||||||
|
};
|
||||||
|
Gfx::IntRect right_border_rect = {
|
||||||
|
border_rect.x() + (border_rect.width() - borders_data.right.width),
|
||||||
|
border_rect.y(),
|
||||||
|
borders_data.right.width,
|
||||||
|
border_rect.height()
|
||||||
|
};
|
||||||
|
Gfx::IntRect bottom_border_rect = {
|
||||||
|
border_rect.x(),
|
||||||
|
border_rect.y() + (border_rect.height() - borders_data.bottom.width),
|
||||||
|
border_rect.width(),
|
||||||
|
borders_data.bottom.width
|
||||||
|
};
|
||||||
|
Gfx::IntRect left_border_rect = {
|
||||||
|
border_rect.x(),
|
||||||
|
border_rect.y(),
|
||||||
|
borders_data.left.width,
|
||||||
|
border_rect.height()
|
||||||
|
};
|
||||||
|
|
||||||
|
painter().fill_rect(top_border_rect, borders_data.top.color);
|
||||||
|
painter().fill_rect(right_border_rect, borders_data.right.color);
|
||||||
|
painter().fill_rect(bottom_border_rect, borders_data.bottom.color);
|
||||||
|
painter().fill_rect(left_border_rect, borders_data.left.color);
|
||||||
|
|
||||||
return CommandResult::Continue;
|
return CommandResult::Continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue