mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-29 19:10:26 +00:00
9b86eb9fad
d66fa60fcf
introduced the use of a timer
to coalesce screen updates. This is OK, but it does introduce update
latency.
To help mitigate the impact of this, we now have a second (immediate)
timer. When a compose pass is first triggered, the immediate timer will
allow the compose to happen on the next spin of the event loop (so, only
coalescing updates across a single event loop pass). Any updates that
trigger while the delayed timer is running, though, will be delayed to
that (~60fps) timer.
This fixes #103.
26 lines
602 B
C++
26 lines
602 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(); }
|
|
int size() const { return m_rects.size(); }
|
|
|
|
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;
|
|
};
|
|
|