1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:48:11 +00:00

LibWeb: Rename LayoutNode::render() to paint()

"Paint" matches what we call this in the rest of the system. Let's not
confuse things by mixing paint/render/draw all the time. I'm guilty of
this in more places..

Also rename RenderingContext => PaintContext.
This commit is contained in:
Andreas Kling 2020-06-18 21:35:44 +02:00
parent dec0cd3755
commit 8c82d26668
26 changed files with 49 additions and 49 deletions

View file

@ -33,7 +33,7 @@
namespace Web {
void LayoutBox::paint_border(RenderingContext& context, Edge edge, const Gfx::FloatRect& rect, CSS::PropertyID style_property_id, CSS::PropertyID color_property_id, CSS::PropertyID width_property_id)
void LayoutBox::paint_border(PaintContext& context, Edge edge, const Gfx::FloatRect& rect, CSS::PropertyID style_property_id, CSS::PropertyID color_property_id, CSS::PropertyID width_property_id)
{
auto border_width = style().property(width_property_id);
if (!border_width.has_value())
@ -186,7 +186,7 @@ void LayoutBox::paint_border(RenderingContext& context, Edge edge, const Gfx::Fl
}
}
void LayoutBox::render(RenderingContext& context, PaintPhase phase)
void LayoutBox::paint(PaintContext& context, PaintPhase phase)
{
if (!is_visible())
return;
@ -230,7 +230,7 @@ void LayoutBox::render(RenderingContext& context, PaintPhase phase)
paint_border(context, Edge::Bottom, bordered_rect, CSS::PropertyID::BorderBottomStyle, CSS::PropertyID::BorderBottomColor, CSS::PropertyID::BorderBottomWidth);
}
LayoutNodeWithStyleAndBoxModelMetrics::render(context, phase);
LayoutNodeWithStyleAndBoxModelMetrics::paint(context, phase);
if (phase == PaintPhase::Overlay && node() && document().inspected_node() == node())
context.painter().draw_rect(enclosing_int_rect(absolute_rect()), Color::Magenta);