1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-04 08:27:35 +00:00
serenity/Userland/Services/WindowServer/VirtualScreenBackend.h
kleines Filmröllchen 935f401714 WindowServer: Create the VirtualScreenBackend
This screen backend is just memory-backed and doesn't connect to any
screen hardware. That way, we can boot Serenity without video hardware
but in full graphical mode :^)

To create a virtual screen, put something like this in your
WindowServer.ini. There's no way yet to do this through Display
Settings, though an existing virtual screen's settings can be changed
there.
```ini
[Screen0]
Mode=Virtual
Left=1024
Top=0
Width=1920
Height=1080
ScaleFactor=1
```
2022-04-21 13:41:55 +02:00

44 lines
1 KiB
C++

/*
* Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "ScreenBackend.h"
#include "ScreenLayout.h"
#include <AK/Error.h>
#include <AK/Span.h>
#include <AK/String.h>
#include <sys/ioctl_numbers.h>
namespace WindowServer {
class VirtualScreenBackend : public ScreenBackend {
public:
virtual ~VirtualScreenBackend();
VirtualScreenBackend() = default;
private:
friend class Screen;
virtual ErrorOr<void> open() override;
virtual void set_head_buffer(int index) override;
virtual ErrorOr<void> flush_framebuffer_rects(int, Span<FBRect const>) override { return {}; }
virtual ErrorOr<void> unmap_framebuffer() override;
virtual ErrorOr<void> map_framebuffer() override;
virtual ErrorOr<void> set_head_resolution(FBHeadResolution) override;
virtual ErrorOr<FBHeadProperties> get_head_properties() override;
int m_height { 0 };
int m_width { 0 };
bool m_first_buffer_active { true };
};
}