field surf for compositing schema

This commit is contained in:
Vincent Wei
2020-01-14 18:21:40 +08:00
parent 944b3fd116
commit e8d6e479e1
8 changed files with 282 additions and 126 deletions

View File

@@ -114,7 +114,11 @@ typedef struct tagCONTROL
HDC privCDC; // the private client DC.
INVRGN InvRgn; // the invalid region of this control.
#ifdef _MGSCHEMA_COMPOSITING
struct GAL_Surface* surf; // the shared surface of this main window.
#else
PGCRINFO pGCRInfo; // pointer to global clip region info struct.
#endif
// the Z order node,
// only for control with WS_EX_CTRLASMAINWIN.

View File

@@ -85,7 +85,6 @@ typedef struct tagDC* PDC;
# ifdef _MGSCHEMA_COMPOSITING
# define LOCK_GCRINFO(pdc)
# define UNLOCK_GCRINFO(pdc)
# define kernel_GetGCRgnInfo(hwnd) NULL
# else /* not defined _MGSCHEMA_COMPOSITING */
void __mg_lock_recalc_gcrinfo (PDC pdc);
void __mg_unlock_gcrinfo (PDC pdc);
@@ -633,12 +632,8 @@ HDC CreateMemDCFromSurface (GAL_Surface* surface);
static inline HDC get_valid_dc (PMAINWIN pWin, BOOL client)
{
#if 1
if (!(pWin->dwExStyle & WS_EX_CTRLASMAINWIN)
&& (pWin->pMainWin->secondaryDC)) {
#else
if (pWin->pMainWin->secondaryDC) {
#endif
if (client && (pWin->dwExStyle & WS_EX_USEPRIVATECDC)) {
return pWin->privCDC;
}

View File

@@ -475,8 +475,10 @@ PMSGQUEUE kernel_GetMsgQueue (HWND hWnd);
/* return the next window need to repaint. */
HWND kernel_CheckInvalidRegion (PMAINWIN pWin);
#ifndef _MGSCHEMA_COMPOSITING
/* return global clipping region of window. */
PGCRINFO kernel_GetGCRgnInfo (HWND hWnd);
#endif
/* internal variables */
typedef struct _TRACKMENUINFO* PTRACKMENUINFO;

View File

@@ -139,18 +139,20 @@ typedef struct _ZORDERINFO
int cli_trackmenu;
HWND ptmi_in_cli;
int zi_semid;
int zi_semnum;
/* The usage bitmap for mask rect. */
int size_maskrect_usage_bmp;
#ifdef _MGRM_THREADS
#ifndef __NOUNIX__
# ifndef __NOUNIX__
pthread_rwlock_t rwlock;
#else
# else
pthread_mutex_t rwlock;
# endif
#elif defined(_MGRM_PROCESSES)
int zi_semid;
int zi_semnum;
#endif
#endif
} ZORDERINFO;
typedef ZORDERINFO* PZORDERINFO;

View File

@@ -3682,10 +3682,8 @@ static LRESULT DesktopWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lP
switch (message) {
case MSG_TIMEOUT:
{
if (mgIsServer) {
MSG msg = {0, MSG_IDLE, wParam, 0};
dskBroadcastMessage (&msg);
}
MSG msg = {0, MSG_IDLE, wParam, 0};
dskBroadcastMessage (&msg);
break;
}

View File

@@ -96,12 +96,21 @@ typedef struct _DEF_CONTEXT
int x, y;
} DEF_CONTEXT;
#ifndef _MGSCHEMA_COMPOSITING
#ifdef _MGSCHEMA_COMPOSITING
unsigned int kernel_GetWndAge (HWND hWnd)
{
PMAINWIN mainwin = ((PMAINWIN)hWnd)->pMainWin;
const ZORDERNODE* nodes;
nodes = GET_ZORDERNODE(__mg_zorder_info);
return nodes[mainwin->idx_znode].age;
}
#else /* not defined _MGSCHEMA_COMPOSITING */
PGCRINFO kernel_GetGCRgnInfo (HWND hWnd)
{
return ((PMAINWIN)hWnd)->pGCRInfo;
}
#endif /* _MGSCHEMA_COMPOSITING */
#endif /* not defined _MGSCHEMA_COMPOSITING */
#if defined(_MGRM_PROCESSES) && !defined(_MGRM_STANDALONE)
static DEF_CONTEXT g_def_context;
@@ -777,6 +786,7 @@ static int dskScrollMainWindow (PMAINWIN pWin, PSCROLLWINDOWINFO pswi)
return 0;
}
#ifndef _MGSCHEMA_COMPOSITING
void __mg_unlock_gcrinfo (PDC pdc)
{
#ifdef _MGRM_THREADS
@@ -878,6 +888,7 @@ void __mg_lock_recalc_gcrinfo (PDC pdc)
gcrinfo->old_zi_age = nodes [idx_znode].age;
gcrinfo->age ++;
}
#endif /* not defined _MGSCHEMA_COMPOSITING */
/*
* Init a window's global clipping region.

File diff suppressed because it is too large Load Diff

View File

@@ -147,6 +147,22 @@ static BOOL do_alloc_layer (MG_Layer* layer, const char* name,
+ zi->max_nr_topmosts + zi->max_nr_normals;
semctl (zi->zi_semid, zi->zi_semnum, SETVAL, arg);
}
#if 0
{
int ret;
pthread_rwlockattr_t attr;
pthread_rwlockattr_init (&attr);
pthread_rwlockattr_setpshared (&attr, PTHREAD_PROCESS_SHARED);
ret = pthread_rwlock_init (&zi->rwlock, &attr);
pthread_rwlockattr_destroy(&attr);
if (ret) {
_ERR_PRINTF("Failed to initialize the pthread rwlock for layer");
return FALSE;
}
}
#endif
memset (zi + 1, 0xFF, SIZE_USAGE_BMP);
/* get a unused mask rect slot. */
@@ -265,11 +281,10 @@ error:
int __mg_init_layers ()
{
key_t sem_key;
int semid = 0;
key_t sem_key;
mgLayers = calloc (1, sizeof (MG_Layer));
if (mgLayers == NULL)
return -1;