no need to check compositing when calling GAL_GetVideo

This commit is contained in:
Vincent Wei
2020-03-11 18:33:21 +08:00
parent e3a167002d
commit 0a42eadb4c
2 changed files with 6 additions and 18 deletions
+1 -4
View File
@@ -63,7 +63,7 @@ typedef struct _VIDEO_MEM_INFO
int video_mem_len;
int video_mem_offset;
int video_pitch;
}VIDEO_MEM_INFO;
} VIDEO_MEM_INFO;
/* Define the GAL video driver structure */
@@ -267,8 +267,6 @@ typedef struct VideoBootStrap {
const char *desc;
int (*available)(void);
GAL_VideoDevice *(*create)(int devindex);
/* Since 5.0.0; used to check where the video engine support composition schema */
BOOL compositing_enabled;
} VideoBootStrap;
#ifdef _MGGAL_DUMMY
@@ -383,7 +381,6 @@ extern GAL_VideoDevice *__mg_current_video;
#define GAL_VideoSurface (__mg_current_video->screen)
#define GAL_PublicSurface (__mg_current_video->screen)
GAL_VideoDevice *GAL_GetVideo (const char* driver_name, BOOL check_compos);
void Slave_FreeSurface (GAL_Surface *surface);
#endif /* _GAL_sysvideo_h */
+5 -14
View File
@@ -173,7 +173,7 @@ BLOCKHEAP __mg_free_update_region_list;
int GAL_VideoInit(const char *driver_name, Uint32 flags);
void GAL_VideoQuit(void);
GAL_VideoDevice *GAL_GetVideo(const char* driver_name, BOOL check_compos)
static GAL_VideoDevice *GAL_GetVideo(const char* driver_name)
{
GAL_VideoDevice *video;
int index;
@@ -186,20 +186,15 @@ GAL_VideoDevice *GAL_GetVideo(const char* driver_name, BOOL check_compos)
if (strncmp(bootstrap[i]->name, driver_name,
strlen(bootstrap[i]->name)) == 0) {
if (bootstrap[i]->available()) {
if (check_compos && !bootstrap[i]->compositing_enabled)
return NULL;
video = bootstrap[i]->create(index);
break;
}
}
}
} else {
}
else {
for (i=0; bootstrap[i]; ++i) {
if (bootstrap[i]->available()) {
if (check_compos && !bootstrap[i]->compositing_enabled)
continue;
video = bootstrap[i]->create(index);
if (video != NULL) {
break;
@@ -242,11 +237,7 @@ int GAL_VideoInit (const char *driver_name, Uint32 flags)
GAL_VideoQuit();
}
#if defined(_MGRM_PROCESSES) && defined(_MGSCHEMA_COMPOSITING)
video = GAL_GetVideo(driver_name, FALSE);
#else
video = GAL_GetVideo(driver_name, FALSE);
#endif
video = GAL_GetVideo(driver_name);
if (video == NULL) {
return (-1);
}
@@ -1466,7 +1457,7 @@ GAL_Surface *gal_SlaveVideoInit(const char* driver_name, const char* mode, int d
unsigned int w, h, depth;
/* Select the proper video driver */
video = GAL_GetVideo(driver_name, FALSE);
video = GAL_GetVideo(driver_name);
if (video == NULL) {
_ERR_PRINTF ("NEWGAL: Does not find the slave video engine: %s.\n",