1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:07:36 +00:00

LibGfx: Make Painter::draw_rect() scale-aware

Needed for the window server minimize animation.

draw_rect() can't just call draw_line() because that isn't
draw_op()-aware. The draw_op()-awareness in Painter looks a bit ad-hoc,
but that's for another day.
This commit is contained in:
Nico Weber 2021-01-12 20:22:15 -05:00 committed by Andreas Kling
parent ddd0c1dd8b
commit 56cad36ef2
3 changed files with 41 additions and 23 deletions

View file

@ -135,8 +135,8 @@ protected:
IntRect to_physical(const IntRect& r) const { return (r * scale()).translated(translation()); }
IntPoint to_physical(const IntPoint& p) const { return (p * scale()).translated(translation()); }
int scale() const { return state().scale; }
void set_pixel_with_draw_op(u32& pixel, const Color&);
void fill_scanline_with_draw_op(int y, int x, int width, const Color& color);
void set_physical_pixel_with_draw_op(u32& pixel, const Color&);
void fill_physical_scanline_with_draw_op(int y, int x, int width, const Color& color);
void fill_rect_with_draw_op(const IntRect&, Color);
void blit_with_alpha(const IntPoint&, const Gfx::Bitmap&, const IntRect& src_rect);
void blit_with_opacity(const IntPoint&, const Gfx::Bitmap&, const IntRect& src_rect, float opacity);