1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:17:35 +00:00

AK: Simplify Bitmap and implement in terms of BitmapView

Add Bitmap::view() and forward most of the calls to BitmapView since
the code was identical.

Bitmap is now primarily concerned with its dynamically allocated
backing store and BitmapView deals with the rest.
This commit is contained in:
Andreas Kling 2021-03-04 11:05:34 +01:00
parent ed9ab38b3b
commit 1208fc7d37
3 changed files with 40 additions and 412 deletions

View file

@ -98,7 +98,7 @@ public:
void will_track_seen_events(size_t profile_event_count)
{
if (m_seen_events.size() != profile_event_count)
m_seen_events = Bitmap::create(profile_event_count, false);
m_seen_events = Bitmap { profile_event_count, false };
}
bool has_seen_event(size_t event_index) const { return m_seen_events.get(event_index); }
void did_see_event(size_t event_index) { m_seen_events.set(event_index, true); }