mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +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,15 +14,16 @@
|
|||
#include <LibWeb/Page/Page.h>
|
||||
#include <LibWeb/Painting/DisplayListPlayerSkia.h>
|
||||
#include <LibWeb/StorageAPI/StorageShed.h>
|
||||
|
||||
#ifdef USE_VULKAN
|
||||
# include <LibGfx/VulkanContext.h>
|
||||
#endif
|
||||
#include <WebContent/BackingStoreManager.h>
|
||||
|
||||
#ifdef AK_OS_MACOS
|
||||
# include <LibGfx/MetalContext.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_VULKAN
|
||||
# include <LibGfx/VulkanContext.h>
|
||||
#endif
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/document-sequences.html#traversable-navigable
|
||||
|
@ -110,6 +111,8 @@ public:
|
|||
StorageAPI::StorageShed& storage_shed() { return m_storage_shed; }
|
||||
StorageAPI::StorageShed const& storage_shed() const { return m_storage_shed; }
|
||||
|
||||
void set_viewport_size(CSSPixelSize) override;
|
||||
|
||||
private:
|
||||
TraversableNavigable(GC::Ref<Page>);
|
||||
|
||||
|
@ -131,6 +134,8 @@ private:
|
|||
|
||||
[[nodiscard]] bool can_go_forward() const;
|
||||
|
||||
NonnullRefPtr<Gfx::PaintingSurface> painting_surface_for_backing_store(Painting::BackingStore&);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/document-sequences.html#tn-current-session-history-step
|
||||
int m_current_session_history_step { 0 };
|
||||
|
||||
|
@ -154,6 +159,8 @@ private:
|
|||
String m_window_handle;
|
||||
|
||||
RefPtr<Gfx::SkiaBackendContext> m_skia_backend_context;
|
||||
OwnPtr<Painting::DisplayListPlayerSkia> m_skia_player;
|
||||
HashMap<Gfx::Bitmap*, NonnullRefPtr<Gfx::PaintingSurface>> m_bitmap_to_surface;
|
||||
};
|
||||
|
||||
struct BrowsingContextAndDocument {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue