util/dirty_rect.h: accessor for empty state

Provide an easy way to check for the absence of any dirty pixels.

Issue #5344
This commit is contained in:
Norman Feske 2024-09-17 17:27:22 +02:00 committed by Christian Helmuth
parent 2d3c2fc258
commit c527a4e0e4

View File

@ -136,6 +136,15 @@ class Genode::Dirty_rect
rect = rect.valid() ? Rect::compound(rect, added) : added;
}
bool empty() const
{
for (unsigned i = 0; i < NUM_RECTS; i++)
if (_rects[i].area.count())
return false;
return true;
}
};
#endif /* _INCLUDE__UTIL__DIRTY_RECT_H_ */