mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-26 20:45:36 +08:00
_MGUSE_SYNC_UPDATE -> _MGUSE_UPDATE_REGION
This commit is contained in:
@@ -187,7 +187,7 @@ typedef struct GAL_Surface {
|
||||
/* clipping information */
|
||||
GAL_Rect clip_rect; /* Read-only */
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
/* update region */
|
||||
CLIPRGN update_region; /* Read-only */
|
||||
#endif
|
||||
@@ -400,11 +400,12 @@ void GAL_UpdateRects
|
||||
void GAL_UpdateRect
|
||||
(GAL_Surface *screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h);
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
BLOCKHEAP __mg_free_update_region_list;
|
||||
BOOL GAL_SyncUpdate (GAL_Surface *screen);
|
||||
#endif
|
||||
|
||||
BOOL GAL_SyncUpdate (GAL_Surface *screen);
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* On hardware that supports double-buffering, this function sets up a flip
|
||||
|
||||
@@ -1830,7 +1830,7 @@ GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
|
||||
|
||||
GAL_SetClipRect(surface, NULL);
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
/* Initialize update region */
|
||||
InitClipRgn (&surface->update_region, &__mg_free_update_region_list);
|
||||
#endif
|
||||
@@ -1929,7 +1929,7 @@ GAL_Surface* __drm_create_surface_from_handle (GHANDLE video,
|
||||
|
||||
GAL_SetClipRect(surface, NULL);
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
/* Initialize update region */
|
||||
InitClipRgn (&surface->update_region, &__mg_free_update_region_list);
|
||||
#endif
|
||||
@@ -2028,7 +2028,7 @@ GAL_Surface* __drm_create_surface_from_prime_fd (GHANDLE video,
|
||||
|
||||
GAL_SetClipRect(surface, NULL);
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
/* Initialize update region */
|
||||
InitClipRgn (&surface->update_region, &__mg_free_update_region_list);
|
||||
#endif
|
||||
|
||||
@@ -107,7 +107,7 @@ GAL_Surface * GAL_CreateCursorSurface (GAL_VideoDevice *video,
|
||||
surface->dirty_info = NULL;
|
||||
GAL_SetClipRect (surface, NULL);
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
/* Initialize update region */
|
||||
InitClipRgn (&surface->update_region, &__mg_free_update_region_list);
|
||||
#endif
|
||||
|
||||
@@ -141,7 +141,7 @@ GAL_Surface * GAL_CreateSharedRGBSurface (GAL_VideoDevice *video,
|
||||
surface->dirty_info = NULL;
|
||||
GAL_SetClipRect (surface, NULL);
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
/* Initialize update region */
|
||||
InitClipRgn (&surface->update_region, &__mg_free_update_region_list);
|
||||
#endif
|
||||
@@ -414,7 +414,7 @@ GAL_Surface * GAL_AttachSharedRGBSurface (int fd, size_t map_size,
|
||||
surface->format_version = 0;
|
||||
GAL_SetClipRect (surface, NULL);
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
/* Initialize update region */
|
||||
InitClipRgn (&surface->update_region, &__mg_free_update_region_list);
|
||||
#endif
|
||||
|
||||
@@ -144,7 +144,7 @@ GAL_Surface * GAL_CreateRGBSurface (Uint32 flags,
|
||||
#endif
|
||||
GAL_SetClipRect(surface, NULL);
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
/* Initialize update region */
|
||||
InitClipRgn (&surface->update_region, &__mg_free_update_region_list);
|
||||
#endif
|
||||
@@ -1706,7 +1706,7 @@ void GAL_FreeSurface (GAL_Surface *surface)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
EmptyClipRgn (&surface->update_region);
|
||||
#endif
|
||||
|
||||
|
||||
+26
-11
@@ -50,7 +50,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define _DEBUG
|
||||
#include "common.h"
|
||||
#include "minigui.h"
|
||||
#include "gal.h"
|
||||
@@ -165,7 +164,7 @@ static VideoBootStrap *bootstrap[] = {
|
||||
|
||||
GAL_VideoDevice *__mg_current_video = NULL;
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
BLOCKHEAP __mg_free_update_region_list;
|
||||
#endif
|
||||
|
||||
@@ -233,7 +232,7 @@ int GAL_VideoInit (const char *driver_name, Uint32 flags)
|
||||
GAL_PixelFormat vformat;
|
||||
Uint32 video_flags;
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
InitFreeClipRectList (&__mg_free_update_region_list, SIZE_UPDATERECTHEAP);
|
||||
#endif
|
||||
|
||||
@@ -794,7 +793,7 @@ static void mark_surface_dirty (GAL_Surface* surface,
|
||||
di->nr_dirty_rcs = 1;
|
||||
di->dirty_rcs[0] = rc_bound;
|
||||
|
||||
_WRN_PRINTF("Too many un-synced dirty rects, merged to one.\n");
|
||||
_DBG_PRINTF("Too many un-synced dirty rects, merged to one.\n");
|
||||
}
|
||||
|
||||
di->dirty_age++;
|
||||
@@ -809,9 +808,9 @@ static void mark_surface_dirty (GAL_Surface* surface,
|
||||
#include "sharedres.h"
|
||||
#include "ourhdr.h"
|
||||
#include "drawsemop.h"
|
||||
#endif
|
||||
#endif /* defined _MGSCHEMA_COMPOSITING */
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
|
||||
static inline void add_rects_to_update_region (CLIPRGN* region,
|
||||
int numrects, GAL_Rect *rects)
|
||||
@@ -900,6 +899,7 @@ BOOL GAL_SyncUpdate (GAL_Surface *surface)
|
||||
GAL_VideoDevice *this = (GAL_VideoDevice *)surface->video;
|
||||
GAL_Rect rects[NR_DIRTY_RECTS];
|
||||
int numrects;
|
||||
BOOL rc = TRUE;
|
||||
|
||||
numrects = __mg_convert_region_to_rects (&surface->update_region,
|
||||
rects, NR_DIRTY_RECTS);
|
||||
@@ -925,13 +925,17 @@ BOOL GAL_SyncUpdate (GAL_Surface *surface)
|
||||
else if (this->UpdateSurfaceRects) {
|
||||
this->UpdateSurfaceRects (this, surface, numrects, rects);
|
||||
}
|
||||
|
||||
if (this->SyncUpdate) {
|
||||
rc = this->SyncUpdate (this);
|
||||
}
|
||||
}
|
||||
|
||||
EmptyClipRgn (&surface->update_region);
|
||||
return TRUE;
|
||||
return rc;
|
||||
}
|
||||
|
||||
#else /* defined _MGUSE_SYNC_UPDATE */
|
||||
#else /* defined _MGUSE_UPDATE_REGION */
|
||||
|
||||
void GAL_UpdateRects (GAL_Surface *surface, int numrects, GAL_Rect *rects)
|
||||
{
|
||||
@@ -956,7 +960,18 @@ void GAL_UpdateRects (GAL_Surface *surface, int numrects, GAL_Rect *rects)
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* not defined _MGUSE_SYNC_UPDATE */
|
||||
BOOL GAL_SyncUpdate (GAL_Surface *surface)
|
||||
{
|
||||
GAL_VideoDevice *this = (GAL_VideoDevice *)surface->video;
|
||||
|
||||
if (this && this->SyncUpdate) {
|
||||
return this->SyncUpdate (this);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#endif /* not defined _MGUSE_UPDATE_REGION */
|
||||
|
||||
static void SetPalette_logical(GAL_Surface *screen, GAL_Color *colors,
|
||||
int firstcolor, int ncolors)
|
||||
@@ -1137,7 +1152,7 @@ void GAL_VideoQuit (void)
|
||||
video->free(this);
|
||||
__mg_current_video = NULL;
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
DestroyFreeClipRectList (&__mg_free_update_region_list);
|
||||
#endif
|
||||
}
|
||||
@@ -1248,7 +1263,7 @@ static GAL_Surface *Slave_CreateSurface (GAL_VideoDevice *this,
|
||||
#endif
|
||||
GAL_SetClipRect(surface, NULL);
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
#ifdef _MGUSE_UPDATE_REGION
|
||||
/* Initialize update region */
|
||||
InitClipRgn (&surface->update_region, &__mg_free_update_region_list);
|
||||
#endif
|
||||
|
||||
+7
-6
@@ -2295,11 +2295,9 @@ void GUIAPI ReleaseDC (HDC hDC)
|
||||
pdc->alpha_pixel_format = NULL;
|
||||
}
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
LOCK (&__mg_gdilock);
|
||||
GAL_SyncUpdate (pdc->surface);
|
||||
UNLOCK (&__mg_gdilock);
|
||||
#endif
|
||||
|
||||
pWin = (PMAINWIN)(pdc->hwnd);
|
||||
if (pWin && pWin->privCDC == hDC) {
|
||||
@@ -3957,7 +3955,6 @@ int GUIAPI SetUserCompositionOps (HDC hdc, CB_COMP_SETPIXEL comp_setpixel,
|
||||
return old_rop;
|
||||
}
|
||||
|
||||
#ifdef _MGUSE_SYNC_UPDATE
|
||||
BOOL GUIAPI SyncUpdateDC (HDC hdc)
|
||||
{
|
||||
BOOL rc;
|
||||
@@ -3969,12 +3966,12 @@ BOOL GUIAPI SyncUpdateDC (HDC hdc)
|
||||
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(_MGUSE_SYNC_UPDATE) && defined(_MGSCHEMA_COMPOSITING)
|
||||
BOOL GUIAPI SyncUpdateSurface (HWND hwnd)
|
||||
{
|
||||
BOOL rc = FALSE;
|
||||
|
||||
#ifdef _MGSCHEMA_COMPOSITING
|
||||
PMAINWIN main_win = getMainWindowPtr (hwnd);
|
||||
|
||||
if (main_win && main_win->surf) {
|
||||
@@ -3982,10 +3979,14 @@ BOOL GUIAPI SyncUpdateSurface (HWND hwnd)
|
||||
rc = GAL_SyncUpdate (main_win->surf);
|
||||
UNLOCK (&__mg_gdilock);
|
||||
}
|
||||
#else
|
||||
LOCK (&__mg_gdilock);
|
||||
rc = GAL_SyncUpdate (__gal_screen);
|
||||
UNLOCK (&__mg_gdilock);
|
||||
#endif
|
||||
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL GUIAPI IsMemDC (HDC hdc)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user