2022-03-10 14:02:25 +01:00
|
|
|
/*
|
2024-10-04 13:19:50 +02:00
|
|
|
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
|
2022-03-10 14:02:25 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibWeb/Layout/CanvasBox.h>
|
2022-03-10 23:13:37 +01:00
|
|
|
#include <LibWeb/Painting/PaintableBox.h>
|
2022-03-10 14:02:25 +01:00
|
|
|
|
|
|
|
|
namespace Web::Painting {
|
|
|
|
|
|
2022-03-10 15:50:57 +01:00
|
|
|
class CanvasPaintable final : public PaintableBox {
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_CELL(CanvasPaintable, PaintableBox);
|
|
|
|
|
GC_DECLARE_ALLOCATOR(CanvasPaintable);
|
2023-01-11 12:51:49 +01:00
|
|
|
|
2022-03-10 14:02:25 +01:00
|
|
|
public:
|
2024-11-15 04:01:23 +13:00
|
|
|
static GC::Ref<CanvasPaintable> create(Layout::CanvasBox const&);
|
2022-03-10 14:02:25 +01:00
|
|
|
|
|
|
|
|
virtual void paint(PaintContext&, PaintPhase) const override;
|
|
|
|
|
|
|
|
|
|
Layout::CanvasBox const& layout_box() const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
CanvasPaintable(Layout::CanvasBox const&);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|