summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Base/home/anon/WindowManager.ini2
-rwxr-xr-xDemos/PaintTest/PaintTestbin276244 -> 0 bytes
-rw-r--r--Demos/PaintTest/main.d165
-rw-r--r--Demos/PaintTest/main.obin8384 -> 0 bytes
-rw-r--r--Servers/WindowServer/WSCompositor.cpp10
-rw-r--r--Servers/WindowServer/WSCompositor.h2
-rw-r--r--SharedGraphics/Painter.h1
7 files changed, 11 insertions, 169 deletions
diff --git a/Base/home/anon/WindowManager.ini b/Base/home/anon/WindowManager.ini
index 6c3e941939..30d92d47d1 100644
--- a/Base/home/anon/WindowManager.ini
+++ b/Base/home/anon/WindowManager.ini
@@ -36,4 +36,4 @@ MenuSelectionColor=132,53,26
DoubleClickSpeed=250
[Background]
-Mode=center
+Mode=scaled
diff --git a/Demos/PaintTest/PaintTest b/Demos/PaintTest/PaintTest
deleted file mode 100755
index 771ef316f2..0000000000
--- a/Demos/PaintTest/PaintTest
+++ /dev/null
Binary files differ
diff --git a/Demos/PaintTest/main.d b/Demos/PaintTest/main.d
deleted file mode 100644
index d119b04163..0000000000
--- a/Demos/PaintTest/main.d
+++ /dev/null
@@ -1,165 +0,0 @@
-main.o: main.cpp /home/christopherdumas/serenity/LibGUI/GApplication.h \
- /home/christopherdumas/serenity/AK/Badge.h \
- /home/christopherdumas/serenity/AK/OwnPtr.h \
- /home/christopherdumas/serenity/AK/StdLibExtras.h \
- /home/christopherdumas/serenity/LibC/stdlib.h \
- /home/christopherdumas/serenity/LibC/sys/cdefs.h \
- /home/christopherdumas/serenity/LibC/sys/types.h \
- /home/christopherdumas/serenity/LibC/stdint.h \
- /home/christopherdumas/serenity/LibC/stddef.h \
- /home/christopherdumas/serenity/LibC/string.h \
- /home/christopherdumas/serenity/AK/Types.h \
- /home/christopherdumas/serenity/AK/Traits.h \
- /home/christopherdumas/serenity/AK/kstdio.h \
- /home/christopherdumas/serenity/Kernel/kstdio.h \
- /home/christopherdumas/serenity/AK/HashFunctions.h \
- /home/christopherdumas/serenity/AK/HashMap.h \
- /home/christopherdumas/serenity/AK/HashTable.h \
- /home/christopherdumas/serenity/AK/Assertions.h \
- /home/christopherdumas/serenity/LibC/assert.h \
- /home/christopherdumas/serenity/AK/DoublyLinkedList.h \
- /home/christopherdumas/serenity/AK/Vector.h \
- /home/christopherdumas/serenity/AK/kmalloc.h \
- /home/christopherdumas/serenity/LibGUI/GShortcut.h \
- /home/christopherdumas/serenity/Kernel/KeyCode.h \
- /home/christopherdumas/serenity/AK/AKString.h \
- /home/christopherdumas/serenity/AK/ByteBuffer.h \
- /home/christopherdumas/serenity/AK/Retainable.h \
- /home/christopherdumas/serenity/AK/RetainPtr.h \
- /home/christopherdumas/serenity/AK/Retained.h \
- /home/christopherdumas/serenity/AK/StringImpl.h \
- /home/christopherdumas/serenity/AK/StringView.h \
- /home/christopherdumas/serenity/LibGUI/GWindow.h \
- /home/christopherdumas/serenity/LibCore/CObject.h \
- /home/christopherdumas/serenity/AK/Function.h \
- /home/christopherdumas/serenity/AK/Weakable.h \
- /home/christopherdumas/serenity/LibGUI/GWindowType.h \
- /home/christopherdumas/serenity/SharedGraphics/Rect.h \
- /home/christopherdumas/serenity/SharedGraphics/Point.h \
- /home/christopherdumas/serenity/SharedGraphics/Size.h \
- /home/christopherdumas/serenity/SharedGraphics/TextAlignment.h \
- /home/christopherdumas/serenity/SharedGraphics/GraphicsBitmap.h \
- /home/christopherdumas/serenity/SharedGraphics/Color.h \
- /home/christopherdumas/serenity/AK/MappedFile.h \
- /home/christopherdumas/serenity/LibC/SharedBuffer.h \
- /home/christopherdumas/serenity/AK/WeakPtr.h \
- /home/christopherdumas/serenity/LibGUI/GWidget.h \
- /home/christopherdumas/serenity/LibCore/CElapsedTimer.h \
- /home/christopherdumas/serenity/LibC/time.h \
- /home/christopherdumas/serenity/LibGUI/GEvent.h \
- /home/christopherdumas/serenity/LibCore/CEvent.h \
- /home/christopherdumas/serenity/SharedGraphics/Font.h \
- /home/christopherdumas/serenity/LibGUI/GPainter.h \
- /home/christopherdumas/serenity/SharedGraphics/Painter.h \
- /home/christopherdumas/serenity/SharedGraphics/TextElision.h \
- /home/christopherdumas/serenity/SharedGraphics/PNGLoader.h
-
-/home/christopherdumas/serenity/LibGUI/GApplication.h:
-
-/home/christopherdumas/serenity/AK/Badge.h:
-
-/home/christopherdumas/serenity/AK/OwnPtr.h:
-
-/home/christopherdumas/serenity/AK/StdLibExtras.h:
-
-/home/christopherdumas/serenity/LibC/stdlib.h:
-
-/home/christopherdumas/serenity/LibC/sys/cdefs.h:
-
-/home/christopherdumas/serenity/LibC/sys/types.h:
-
-/home/christopherdumas/serenity/LibC/stdint.h:
-
-/home/christopherdumas/serenity/LibC/stddef.h:
-
-/home/christopherdumas/serenity/LibC/string.h:
-
-/home/christopherdumas/serenity/AK/Types.h:
-
-/home/christopherdumas/serenity/AK/Traits.h:
-
-/home/christopherdumas/serenity/AK/kstdio.h:
-
-/home/christopherdumas/serenity/Kernel/kstdio.h:
-
-/home/christopherdumas/serenity/AK/HashFunctions.h:
-
-/home/christopherdumas/serenity/AK/HashMap.h:
-
-/home/christopherdumas/serenity/AK/HashTable.h:
-
-/home/christopherdumas/serenity/AK/Assertions.h:
-
-/home/christopherdumas/serenity/LibC/assert.h:
-
-/home/christopherdumas/serenity/AK/DoublyLinkedList.h:
-
-/home/christopherdumas/serenity/AK/Vector.h:
-
-/home/christopherdumas/serenity/AK/kmalloc.h:
-
-/home/christopherdumas/serenity/LibGUI/GShortcut.h:
-
-/home/christopherdumas/serenity/Kernel/KeyCode.h:
-
-/home/christopherdumas/serenity/AK/AKString.h:
-
-/home/christopherdumas/serenity/AK/ByteBuffer.h:
-
-/home/christopherdumas/serenity/AK/Retainable.h:
-
-/home/christopherdumas/serenity/AK/RetainPtr.h:
-
-/home/christopherdumas/serenity/AK/Retained.h:
-
-/home/christopherdumas/serenity/AK/StringImpl.h:
-
-/home/christopherdumas/serenity/AK/StringView.h:
-
-/home/christopherdumas/serenity/LibGUI/GWindow.h:
-
-/home/christopherdumas/serenity/LibCore/CObject.h:
-
-/home/christopherdumas/serenity/AK/Function.h:
-
-/home/christopherdumas/serenity/AK/Weakable.h:
-
-/home/christopherdumas/serenity/LibGUI/GWindowType.h:
-
-/home/christopherdumas/serenity/SharedGraphics/Rect.h:
-
-/home/christopherdumas/serenity/SharedGraphics/Point.h:
-
-/home/christopherdumas/serenity/SharedGraphics/Size.h:
-
-/home/christopherdumas/serenity/SharedGraphics/TextAlignment.h:
-
-/home/christopherdumas/serenity/SharedGraphics/GraphicsBitmap.h:
-
-/home/christopherdumas/serenity/SharedGraphics/Color.h:
-
-/home/christopherdumas/serenity/AK/MappedFile.h:
-
-/home/christopherdumas/serenity/LibC/SharedBuffer.h:
-
-/home/christopherdumas/serenity/AK/WeakPtr.h:
-
-/home/christopherdumas/serenity/LibGUI/GWidget.h:
-
-/home/christopherdumas/serenity/LibCore/CElapsedTimer.h:
-
-/home/christopherdumas/serenity/LibC/time.h:
-
-/home/christopherdumas/serenity/LibGUI/GEvent.h:
-
-/home/christopherdumas/serenity/LibCore/CEvent.h:
-
-/home/christopherdumas/serenity/SharedGraphics/Font.h:
-
-/home/christopherdumas/serenity/LibGUI/GPainter.h:
-
-/home/christopherdumas/serenity/SharedGraphics/Painter.h:
-
-/home/christopherdumas/serenity/SharedGraphics/TextElision.h:
-
-/home/christopherdumas/serenity/SharedGraphics/PNGLoader.h:
diff --git a/Demos/PaintTest/main.o b/Demos/PaintTest/main.o
deleted file mode 100644
index 953146a320..0000000000
--- a/Demos/PaintTest/main.o
+++ /dev/null
Binary files differ
diff --git a/Servers/WindowServer/WSCompositor.cpp b/Servers/WindowServer/WSCompositor.cpp
index 67647804b6..32f8754d9f 100644
--- a/Servers/WindowServer/WSCompositor.cpp
+++ b/Servers/WindowServer/WSCompositor.cpp
@@ -24,6 +24,8 @@ WallpaperMode mode_to_enum(const String& name)
return WallpaperMode::Tile;
if (name == "center")
return WallpaperMode::Center;
+ if (name == "scaled")
+ return WallpaperMode::Scaled;
}
WSCompositor::WSCompositor()
@@ -91,8 +93,7 @@ void WSCompositor::compose()
continue;
m_back_painter->fill_rect(dirty_rect, wm.m_background_color);
if (m_wallpaper) {
- if (m_wallpaper_mode == WallpaperMode::Simple ||
- m_wallpaper_mode == WallpaperMode::Unchecked) {
+ if (m_wallpaper_mode == WallpaperMode::Simple) {
m_back_painter->blit(dirty_rect.location(), *m_wallpaper, dirty_rect);
} else if (m_wallpaper_mode == WallpaperMode::Center) {
Point offset{ ws.size().width() / 2 - m_wallpaper->size().width() / 2,
@@ -101,6 +102,11 @@ void WSCompositor::compose()
dirty_rect, offset);
} else if (m_wallpaper_mode == WallpaperMode::Tile) {
m_back_painter->blit_tiled(dirty_rect.location(), *m_wallpaper, dirty_rect);
+ } else {
+ // FIXME: Does not work: offset rect creates trails.
+ m_back_painter->draw_scaled_bitmap(dirty_rect, *m_wallpaper,
+ { dirty_rect.location(),
+ m_wallpaper->size() });
}
}
}
diff --git a/Servers/WindowServer/WSCompositor.h b/Servers/WindowServer/WSCompositor.h
index ea65bd24bf..02440ab553 100644
--- a/Servers/WindowServer/WSCompositor.h
+++ b/Servers/WindowServer/WSCompositor.h
@@ -10,7 +10,7 @@
class Painter;
class WSCursor;
-enum class WallpaperMode { Simple, Tile, Center, Unchecked };
+enum class WallpaperMode { Simple, Tile, Center, Scaled, Unchecked };
class WSCompositor final : public CObject {
public:
diff --git a/SharedGraphics/Painter.h b/SharedGraphics/Painter.h
index 59b87289cb..a9ca1750ac 100644
--- a/SharedGraphics/Painter.h
+++ b/SharedGraphics/Painter.h
@@ -29,6 +29,7 @@ public:
void blit_dimmed(const Point&, const GraphicsBitmap&, const Rect& src_rect);
void blit_tiled(const Point&, const GraphicsBitmap&, const Rect& src_rect);
void blit_offset(const Point&, const GraphicsBitmap&, const Rect& src_rect, const Point&);
+ void blit_scaled(const Point&, const GraphicsBitmap&, const Rect& src_rect, const Size&);
void draw_text(const Rect&, const char* text, int length, const Font&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None);
void draw_text(const Rect&, const char* text, int length, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None);
void draw_text(const Rect&, const String&, const Font&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None);