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

WindowServer: Avoid overdraw by shattering dirty rects into unique shards.

The algorithm I came up with is O(n^2) but given the small numbers of rects
we're typically working with, it doesn't really matter. May need to revisit
this in the future if we find ourselves with a huge number of rects.
This commit is contained in:
Andreas Kling 2019-02-19 14:49:23 +01:00
parent 420b7bd55f
commit 98784ad3cb
7 changed files with 127 additions and 21 deletions

View file

@ -3,6 +3,7 @@
#include <SharedGraphics/Rect.h>
#include <SharedGraphics/Color.h>
#include <SharedGraphics/Painter.h>
#include <SharedGraphics/DisjointRectSet.h>
#include <AK/HashTable.h>
#include <AK/InlineLinkedList.h>
#include <AK/WeakPtr.h>
@ -127,7 +128,7 @@ private:
RetainPtr<GraphicsBitmap> m_front_bitmap;
RetainPtr<GraphicsBitmap> m_back_bitmap;
Vector<Rect> m_dirty_rects;
DisjointRectSet m_dirty_rects;
bool m_pending_compose_event { false };