1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

BitmapView: Disable mutations of the underlying Bitmap

Problem:
- `BitmapView` permits changing the underlying `Bitmap`. This violates
  the idea of a "view" since views are simply overlays which can
  themselves change but do not change the underlying data.

Solution:
- Migrate all non-`const` member functions to Bitmap.
This commit is contained in:
Lenny Maiorani 2021-05-16 18:00:50 -06:00 committed by Andreas Kling
parent 63897c469b
commit ebb1d9740e
3 changed files with 87 additions and 92 deletions

View file

@ -6,7 +6,7 @@
#pragma once
#include <AK/BitmapView.h>
#include <AK/Bitmap.h>
#include <AK/ScopeGuard.h>
#include <AK/TemporaryChange.h>
#include <AK/Vector.h>
@ -153,7 +153,7 @@ private:
size_t m_total_chunks { 0 };
size_t m_allocated_chunks { 0 };
u8* m_chunks { nullptr };
BitmapView m_bitmap;
Bitmap m_bitmap;
};
template<typename ExpandHeap>