mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
In the upcoming changes, we are going to switch macOS to using an IOSurface for the backing store. This change will simplify the process of sharing an IOSurface between processes because we already have the MachPortServer running in the browser, and WebContent knows how to locate the corresponding server.
43 lines
935 B
C++
43 lines
935 B
C++
/*
|
|
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Page/Page.h>
|
|
#include <WebContent/Forward.h>
|
|
|
|
namespace WebContent {
|
|
|
|
class BackingStoreManager {
|
|
public:
|
|
enum class WindowResizingInProgress {
|
|
No,
|
|
Yes
|
|
};
|
|
void resize_backing_stores_if_needed(WindowResizingInProgress window_resize_in_progress);
|
|
void restart_resize_timer();
|
|
|
|
RefPtr<Gfx::Bitmap> back_bitmap() { return m_back_bitmap; }
|
|
i32 front_id() const { return m_front_bitmap_id; }
|
|
|
|
void swap_back_and_front();
|
|
|
|
BackingStoreManager(PageClient&);
|
|
|
|
private:
|
|
PageClient& m_page_client;
|
|
|
|
i32 m_front_bitmap_id { -1 };
|
|
i32 m_back_bitmap_id { -1 };
|
|
RefPtr<Gfx::Bitmap> m_front_bitmap;
|
|
RefPtr<Gfx::Bitmap> m_back_bitmap;
|
|
int m_next_bitmap_id { 0 };
|
|
|
|
RefPtr<Core::Timer> m_backing_store_shrink_timer;
|
|
};
|
|
|
|
}
|