summaryrefslogtreecommitdiff
path: root/Userland/Services/WindowServer/MultiScaleBitmaps.h
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2021-06-20 13:23:43 -0600
committerAndreas Kling <kling@serenityos.org>2021-06-25 20:38:13 +0200
commit41859ad3feda56463ce0f73b898714ae17670ca6 (patch)
tree2592325a640c338620870c27fd16aee3174ef9ca /Userland/Services/WindowServer/MultiScaleBitmaps.h
parent42cb38b71a469c5b68280f9bc4b54a895781159d (diff)
downloadserenity-41859ad3feda56463ce0f73b898714ae17670ca6.zip
WindowServer: Add an Overlay class for flicker-free overlay rendering
An Overlay is similar to a transparent window, but has less overhead and does not get rendered within the window stack. Basically, the area that an Overlay occupies forces transparency rendering for any window underneath, which allows us to render them flicker-free. This also adds a new API that allows displaying the screen numbers, e.g. while the user configures the screen layout in DisplaySettings Because other things like drag&drop or the window-size label are not yet converted to use this new mechanism, they will be drawn over the screen-number currently.
Diffstat (limited to 'Userland/Services/WindowServer/MultiScaleBitmaps.h')
-rw-r--r--Userland/Services/WindowServer/MultiScaleBitmaps.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Services/WindowServer/MultiScaleBitmaps.h b/Userland/Services/WindowServer/MultiScaleBitmaps.h
index 830ef97c58..ee0593c44d 100644
--- a/Userland/Services/WindowServer/MultiScaleBitmaps.h
+++ b/Userland/Services/WindowServer/MultiScaleBitmaps.h
@@ -15,12 +15,15 @@ namespace WindowServer {
class MultiScaleBitmaps : public RefCounted<MultiScaleBitmaps> {
public:
+ static RefPtr<MultiScaleBitmaps> create_empty();
static RefPtr<MultiScaleBitmaps> create(StringView const& filename, StringView const& default_filename = {});
Gfx::Bitmap const& default_bitmap() const { return bitmap(1); }
Gfx::Bitmap const& bitmap(int scale_factor) const;
+ Gfx::Bitmap const* find_bitmap(int scale_factor) const;
Gfx::BitmapFormat format() const { return m_format; }
bool load(StringView const& filename, StringView const& default_filename = {});
+ void add_bitmap(int scale_factor, NonnullRefPtr<Gfx::Bitmap>&&);
private:
MultiScaleBitmaps() = default;