mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-25 19:13:46 +08:00
use a small static buffer for zero size surface
This commit is contained in:
@@ -160,6 +160,12 @@ GAL_Surface * GAL_CreateRGBSurface (Uint32 flags,
|
||||
surface->flags &= ~GAL_HWSURFACE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* set a static buff to pixels for empty surface */
|
||||
static char buff[8];
|
||||
surface->flags |= GAL_PREALLOC;
|
||||
surface->pixels = buff;
|
||||
}
|
||||
|
||||
/* Allocate an empty mapping */
|
||||
surface->map = GAL_AllocBlitMap();
|
||||
|
||||
Reference in New Issue
Block a user