mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:57:35 +00:00
WindowServer: New API for Scaled Blit
This commit is contained in:
parent
90d924a97c
commit
908d9458c7
4 changed files with 6 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
||||||
[Screen]
|
[Screen]
|
||||||
Width=1080
|
Width=1024
|
||||||
Height=768
|
Height=768
|
||||||
|
|
||||||
[Cursor]
|
[Cursor]
|
||||||
|
@ -36,4 +36,4 @@ MenuSelectionColor=132,53,26
|
||||||
DoubleClickSpeed=250
|
DoubleClickSpeed=250
|
||||||
|
|
||||||
[Background]
|
[Background]
|
||||||
Mode=center
|
Mode=scaled
|
||||||
|
|
|
@ -107,7 +107,7 @@ void WSCompositor::compose()
|
||||||
float hscale = (float)m_wallpaper->size().width() / (float)ws.size().width();
|
float hscale = (float)m_wallpaper->size().width() / (float)ws.size().width();
|
||||||
float vscale = (float)m_wallpaper->size().height() / (float)ws.size().height();
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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());
|
auto clipped_rect = dst_rect.intersected(clip_rect());
|
||||||
if (clipped_rect.is_empty())
|
if (clipped_rect.is_empty())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
void blit_dimmed(const Point&, const GraphicsBitmap&, const Rect& src_rect);
|
void blit_dimmed(const Point&, const GraphicsBitmap&, const Rect& src_rect);
|
||||||
void blit_tiled(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_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&, 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_text(const Rect&, const StringView&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None);
|
||||||
void draw_glyph(const Point&, char, Color);
|
void draw_glyph(const Point&, char, Color);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue