mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibGfx+LibWeb: Reuse DisplayListPlayer and PaintingSurface when possible
Previously, we were reinstantiating the DisplayListPlayer and PaintingSurface on every paint.
This commit is contained in:
parent
a4639b3d8e
commit
342cb7addf
Notes:
github-actions[bot]
2025-01-31 12:29:12 +00:00
Author: https://github.com/gmta
Commit: 342cb7addf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3400
Reviewed-by: https://github.com/kalenikaliaksandr
12 changed files with 107 additions and 104 deletions
|
@ -14,21 +14,13 @@ class GrDirectContext;
|
|||
|
||||
namespace Web::Painting {
|
||||
|
||||
class DisplayListPlayerSkia : public DisplayListPlayer {
|
||||
class DisplayListPlayerSkia final : public DisplayListPlayer {
|
||||
public:
|
||||
DisplayListPlayerSkia(Gfx::Bitmap&);
|
||||
|
||||
#ifdef USE_VULKAN
|
||||
DisplayListPlayerSkia(Gfx::SkiaBackendContext&, Gfx::Bitmap&);
|
||||
#endif
|
||||
|
||||
#ifdef AK_OS_MACOS
|
||||
DisplayListPlayerSkia(Gfx::SkiaBackendContext&, NonnullRefPtr<Gfx::PaintingSurface>);
|
||||
#endif
|
||||
|
||||
virtual ~DisplayListPlayerSkia() override;
|
||||
DisplayListPlayerSkia(RefPtr<Gfx::SkiaBackendContext>);
|
||||
DisplayListPlayerSkia();
|
||||
|
||||
private:
|
||||
void flush() override;
|
||||
void draw_glyph_run(DrawGlyphRun const&) override;
|
||||
void fill_rect(FillRect const&) override;
|
||||
void draw_painting_surface(DrawPaintingSurface const&) override;
|
||||
|
@ -68,12 +60,7 @@ private:
|
|||
|
||||
bool would_be_fully_clipped_by_painter(Gfx::IntRect) const override;
|
||||
|
||||
Gfx::PaintingSurface& surface() const;
|
||||
|
||||
RefPtr<Gfx::SkiaBackendContext> m_context {};
|
||||
RefPtr<Gfx::PaintingSurface> m_surface {};
|
||||
|
||||
Function<void()> m_flush_context;
|
||||
RefPtr<Gfx::SkiaBackendContext> m_context;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue