1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

WindowServer: Only blit dirty rect of windows to back buffer.

Previously we'd blit every pixel in every window that intersected any dirty
rect to the back buffer. With this patch, we limit ourselves to blitting the
pixels inside the actual dirty rects.

There's still a lot of optimizations to make in this code.
This commit is contained in:
Andreas Kling 2019-01-20 23:42:36 +01:00
parent 1586bc99e3
commit 3271c115e2
7 changed files with 61 additions and 35 deletions

View file

@ -28,7 +28,7 @@ public:
void set_pixel(const Point&, Color);
void draw_line(const Point&, const Point&, Color);
void draw_focus_rect(const Rect&);
void blit(const Point&, const GraphicsBitmap&);
void blit(const Point&, const GraphicsBitmap&, const Rect& src_rect);
enum class TextAlignment { TopLeft, CenterLeft, Center };
void draw_text(const Rect&, const String&, TextAlignment = TextAlignment::TopLeft, Color = Color());
@ -40,6 +40,10 @@ public:
void set_draw_op(DrawOp op) { m_draw_op = op; }
DrawOp draw_op() const { return m_draw_op; }
void set_clip_rect(const Rect& rect) { m_clip_rect = rect; }
void clear_clip_rect() { m_clip_rect = { 0, 0, 1024, 768 }; }
Rect clip_rect() const { return m_clip_rect; }
private:
void set_pixel_with_draw_op(dword& pixel, const Color&);