mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
WindowServer: Add an IPC call for taking a screenshot
This patch adds Messages::WindowServer::GetScreenBitmap. It returns the currently displayed on-screen bitmap as-is, as a Gfx::ShareableBitmap.
This commit is contained in:
parent
557927f25b
commit
d9f8f6a2d0
Notes:
sideshowbarker
2024-07-18 21:04:13 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d9f8f6a2d0e
@ -987,4 +987,10 @@ void ClientConnection::did_become_responsive()
|
||||
set_unresponsive(false);
|
||||
}
|
||||
|
||||
OwnPtr<Messages::WindowServer::GetScreenBitmapResponse> ClientConnection::handle(const Messages::WindowServer::GetScreenBitmap&)
|
||||
{
|
||||
auto& bitmap = Compositor::the().front_bitmap_for_screenshot({});
|
||||
return make<Messages::WindowServer::GetScreenBitmapResponse>(bitmap.to_shareable_bitmap());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -167,6 +167,7 @@ private:
|
||||
virtual OwnPtr<Messages::WindowServer::GetMouseAccelerationResponse> handle(const Messages::WindowServer::GetMouseAcceleration&) override;
|
||||
virtual OwnPtr<Messages::WindowServer::SetScrollStepSizeResponse> handle(const Messages::WindowServer::SetScrollStepSize&) override;
|
||||
virtual OwnPtr<Messages::WindowServer::GetScrollStepSizeResponse> handle(const Messages::WindowServer::GetScrollStepSize&) override;
|
||||
virtual OwnPtr<Messages::WindowServer::GetScreenBitmapResponse> handle(const Messages::WindowServer::GetScreenBitmap&) override;
|
||||
|
||||
Window* window_from_id(i32 window_id);
|
||||
|
||||
|
@ -76,6 +76,8 @@ public:
|
||||
|
||||
void did_construct_window_manager(Badge<WindowManager>);
|
||||
|
||||
const Gfx::Bitmap& front_bitmap_for_screenshot(Badge<ClientConnection>) const { return *m_front_bitmap; }
|
||||
|
||||
private:
|
||||
Compositor();
|
||||
void init_bitmaps();
|
||||
|
@ -123,5 +123,7 @@ endpoint WindowServer = 2
|
||||
SetScrollStepSize(u32 step_size) => ()
|
||||
GetScrollStepSize() => (u32 step_size)
|
||||
|
||||
GetScreenBitmap() => (Gfx::ShareableBitmap bitmap)
|
||||
|
||||
Pong() =|
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user