Force Voodoo blit

Certain applications using the Voodoo adapter stop blitting
when there's no activity (e.g mouse movement, animation).
This results in a black screen when events like window/full screen
transitions take place. Usually this can be fixed by
moving the mouse or with keyboard inout. This change forces
a blit to refresh the screen.

In addition, added critical sections since they are lighter
than mutexes.
This commit is contained in:
luisjoseromero
2021-01-14 00:19:47 +00:00
parent efe7fc4043
commit eca2625093
5 changed files with 115 additions and 2 deletions

View File

@@ -167,3 +167,60 @@ thread_release_mutex(mutex_t *mutex)
return(!!ReleaseMutex((HANDLE)mutex));
}
lightmutex_t *
thread_create_light_mutex()
{
return thread_create_light_mutex_and_spin_count(LIGHT_MUTEX_DEFAULT_SPIN_COUNT);
}
lightmutex_t *
thread_create_light_mutex_and_spin_count(unsigned int spin_count)
{
lightmutex_t *lightmutex = malloc(sizeof(CRITICAL_SECTION));
InitializeCriticalSectionAndSpinCount(lightmutex, spin_count);
return lightmutex;
}
int
thread_wait_light_mutex(lightmutex_t *lightmutex)
{
if (lightmutex == NULL) return(0);
LPCRITICAL_SECTION critsec = (LPCRITICAL_SECTION)lightmutex;
EnterCriticalSection(critsec);
return 1;
}
int
thread_release_light_mutex(lightmutex_t *lightmutex)
{
if (lightmutex == NULL) return(0);
LPCRITICAL_SECTION critsec = (LPCRITICAL_SECTION)lightmutex;
LeaveCriticalSection(critsec);
return 1;
}
void
thread_close_light_mutex(lightmutex_t *lightmutex)
{
if (lightmutex == NULL) return;
LPCRITICAL_SECTION critsec = (LPCRITICAL_SECTION)lightmutex;
DeleteCriticalSection(critsec);
free(critsec);
}