mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:08:12 +00:00
LibWeb: Move set_needs_display() from layout node to paintable
For this method, there is no need to go through the layout node when we can directly reach the paintable.
This commit is contained in:
parent
814bed33b4
commit
7c2713c14f
21 changed files with 97 additions and 87 deletions
|
@ -21,6 +21,7 @@
|
|||
#include <LibWeb/HTML/TextMetrics.h>
|
||||
#include <LibWeb/Infra/CharacterTypes.h>
|
||||
#include <LibWeb/Layout/TextNode.h>
|
||||
#include <LibWeb/Painting/Paintable.h>
|
||||
#include <LibWeb/Platform/FontPlugin.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
|
||||
|
@ -174,9 +175,9 @@ WebIDL::ExceptionOr<void> CanvasRenderingContext2D::draw_image_internal(CanvasIm
|
|||
void CanvasRenderingContext2D::did_draw(Gfx::FloatRect const&)
|
||||
{
|
||||
// FIXME: Make use of the rect to reduce the invalidated area when possible.
|
||||
if (!canvas_element().layout_node())
|
||||
if (!canvas_element().paintable())
|
||||
return;
|
||||
canvas_element().layout_node()->set_needs_display();
|
||||
canvas_element().paintable()->set_needs_display();
|
||||
}
|
||||
|
||||
Gfx::Painter* CanvasRenderingContext2D::painter()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue