summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Dumas <christopherdumas@gmail.com>2019-06-06 08:34:13 -0700
committerAndreas Kling <awesomekling@gmail.com>2019-06-06 18:35:00 +0200
commit908d9458c7496c0d7828db349f57c84703d4545f (patch)
treee8a13cc5440f24c59c0e54e9376bff58fd6dfae6
parent90d924a97c157fa97267599d96ba649359b63f06 (diff)
downloadserenity-908d9458c7496c0d7828db349f57c84703d4545f.zip
WindowServer: New API for Scaled Blit
-rw-r--r--Base/home/anon/WindowManager.ini4
-rw-r--r--Servers/WindowServer/WSCompositor.cpp2
-rw-r--r--SharedGraphics/Painter.cpp4
-rw-r--r--SharedGraphics/Painter.h2
4 files changed, 6 insertions, 6 deletions
diff --git a/Base/home/anon/WindowManager.ini b/Base/home/anon/WindowManager.ini
index ed3b007148..e4b29dab4a 100644
--- a/Base/home/anon/WindowManager.ini
+++ b/Base/home/anon/WindowManager.ini
@@ -1,5 +1,5 @@
[Screen]
-Width=1080
+Width=1024
Height=768
[Cursor]
@@ -36,4 +36,4 @@ MenuSelectionColor=132,53,26
DoubleClickSpeed=250
[Background]
-Mode=center
+Mode=scaled
diff --git a/Servers/WindowServer/WSCompositor.cpp b/Servers/WindowServer/WSCompositor.cpp
index 3184300f2e..1fc1e4c4f0 100644
--- a/Servers/WindowServer/WSCompositor.cpp
+++ b/Servers/WindowServer/WSCompositor.cpp
@@ -107,7 +107,7 @@ void WSCompositor::compose()
float hscale = (float)m_wallpaper->size().width() / (float)ws.size().width();
float vscale = (float)m_wallpaper->size().height() / (float)ws.size().height();
- m_back_painter->blit_scaled(dirty_rect.location(), *m_wallpaper, dirty_rect, hscale, vscale);
+ m_back_painter->blit_scaled(dirty_rect, *m_wallpaper, dirty_rect, hscale, vscale);
}
}
}
diff --git a/SharedGraphics/Painter.cpp b/SharedGraphics/Painter.cpp
index c1c85c6deb..31d505fc9e 100644
--- a/SharedGraphics/Painter.cpp
+++ b/SharedGraphics/Painter.cpp
@@ -204,9 +204,9 @@ void Painter::draw_bitmap(const Point& p, const GlyphBitmap& bitmap, Color color
}
}
-void Painter::blit_scaled(const Point& position, const GraphicsBitmap& source, const Rect& src_rect, float hscale, float vscale)
+void Painter::blit_scaled(const Rect& dst_rect_raw, const GraphicsBitmap& source, const Rect& src_rect, float hscale, float vscale)
{
- auto dst_rect = Rect(position, src_rect.size()).translated(translation());
+ auto dst_rect = Rect(dst_rect_raw.location(), dst_rect_raw.size()).translated(translation());
auto clipped_rect = dst_rect.intersected(clip_rect());
if (clipped_rect.is_empty())
return;
diff --git a/SharedGraphics/Painter.h b/SharedGraphics/Painter.h
index 66d4904115..9c8e275e40 100644
--- a/SharedGraphics/Painter.h
+++ b/SharedGraphics/Painter.h
@@ -29,7 +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&, float, float);
+ void blit_scaled(const Rect&, const GraphicsBitmap&, const Rect&, float, float);
void draw_text(const Rect&, const StringView&, const Font&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None);
void draw_text(const Rect&, const StringView&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None);
void draw_glyph(const Point&, char, Color);