mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 05:52:46 +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:
		
							parent
							
								
									63897c469b
								
							
						
					
					
						commit
						ebb1d9740e
					
				
					 3 changed files with 87 additions and 92 deletions
				
			
		|  | @ -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> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lenny Maiorani
						Lenny Maiorani