Enhance graphics editor performance with batch processing and profiling

- Integrated performance profiling using ScopedTimer in GraphicsEditor and ScreenEditor for better timing insights.
- Implemented batch texture updates in GraphicsEditor and ScreenEditor to reduce individual texture update calls, improving rendering efficiency.
- Enhanced tile rendering in ScreenEditor with pre-allocated vectors for batch operations, optimizing drawing performance.
- Added safety checks and validation in various components to prevent crashes and ensure data integrity during rendering operations.
- Updated Bitmap and Arena classes to support improved texture management and synchronization, enhancing overall graphics performance.
This commit is contained in:
scawful
2025-09-29 09:04:10 -04:00
parent 22297402fc
commit 4bf4a13dae
12 changed files with 600 additions and 229 deletions

View File

@@ -212,6 +212,13 @@ class Bitmap {
*/
uint8_t FindColorIndex(const SnesColor& color);
/**
* @brief Validate that bitmap data and surface pixels are synchronized
* @return true if synchronized, false if there are issues
* @note This method helps debug surface synchronization problems
*/
bool ValidateDataSurfaceSync();
/**
* @brief Extract an 8x8 tile from the bitmap (SNES standard tile size)
* @param tile_index Index of the tile in the tilesheet
@@ -250,7 +257,7 @@ class Bitmap {
bool modified() const { return modified_; }
bool is_active() const { return active_; }
void set_active(bool active) { active_ = active; }
void set_data(const std::vector<uint8_t> &data) { data_ = data; }
void set_data(const std::vector<uint8_t> &data);
void set_modified(bool modified) { modified_ = modified; }