Beatmup
Beatmup::AbstractBitmap::ReadLock Class Reference

Locks a bitmap for reading on CPU. More...

#include <abstract_bitmap.h>

Public Member Functions

 ReadLock (AbstractBitmap &bitmap)
 
 ~ReadLock ()
 

Private Attributes

AbstractBitmapbitmap
 

Detailed Description

Locks a bitmap for reading on CPU.

Once instantiated on a bitmap, bitmap.getData() returns a valid address. Modifying its content puts the bitmap into inconsistent state. Warning: using this lock in a task (not in the user code) may cause a dead lock.

Definition at line 236 of file abstract_bitmap.h.

Constructor & Destructor Documentation

◆ ReadLock()

AbstractBitmap::ReadLock::ReadLock ( AbstractBitmap bitmap)

Definition at line 235 of file abstract_bitmap.cpp.

235  : bitmap(bitmap) {
236 #ifdef BEATMUP_DEBUG
237  DebugAssertion::check(!bitmap.isDirty(), "Reading a dirty bitmap");
238 #endif
242 }
bool isDirty() const
Returns true if the bitmap does not contain any valid content.
bool isUpToDate(ProcessingTarget) const
virtual void lockPixelData()=0
Locks access to the CPU memory buffer containing pixel data.
static void pullPixels(AbstractBitmap &bitmap)
Copies bitmap from GPU memory to RAM.
Definition: swapper.cpp:48

◆ ~ReadLock()

AbstractBitmap::ReadLock::~ReadLock ( )

Definition at line 245 of file abstract_bitmap.cpp.

245  {
247 }
virtual void unlockPixelData()=0
Unlocks access to the CPU memory buffer containing pixel data.

Member Data Documentation

◆ bitmap

AbstractBitmap& Beatmup::AbstractBitmap::ReadLock::bitmap
private

Definition at line 238 of file abstract_bitmap.h.


The documentation for this class was generated from the following files: