mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
7efd61fcf5
This patch moves to sending up to 32 rects at a time when coordinating the painting between WindowServer and its clients. Rects are also merged into a minimal DisjointRectSet on the server side before painting. Interactive resize looks a lot better after this change, since we can usually do all the repainting needed in one go.
25 lines
554 B
C++
25 lines
554 B
C++
#pragma once
|
|
|
|
#include <AK/Vector.h>
|
|
#include <SharedGraphics/Rect.h>
|
|
|
|
class DisjointRectSet {
|
|
public:
|
|
DisjointRectSet() { }
|
|
~DisjointRectSet() { }
|
|
DisjointRectSet(DisjointRectSet&& other) : m_rects(move(other.m_rects)) { }
|
|
|
|
void add(const Rect&);
|
|
|
|
bool is_empty() const { return m_rects.is_empty(); }
|
|
|
|
void clear() { m_rects.clear(); }
|
|
void clear_with_capacity() { m_rects.clear_with_capacity(); }
|
|
const Vector<Rect, 32>& rects() const { return m_rects; }
|
|
|
|
private:
|
|
void shatter();
|
|
|
|
Vector<Rect, 32> m_rects;
|
|
};
|
|
|