exa: add GC private
This commit is contained in:
parent
5cc67ae94c
commit
5e6a06fe69
11
exa/exa.c
11
exa/exa.c
|
@ -41,6 +41,8 @@ static int exaScreenPrivateKeyIndex;
|
||||||
DevPrivateKey exaScreenPrivateKey = &exaScreenPrivateKeyIndex;
|
DevPrivateKey exaScreenPrivateKey = &exaScreenPrivateKeyIndex;
|
||||||
static int exaPixmapPrivateKeyIndex;
|
static int exaPixmapPrivateKeyIndex;
|
||||||
DevPrivateKey exaPixmapPrivateKey = &exaPixmapPrivateKeyIndex;
|
DevPrivateKey exaPixmapPrivateKey = &exaPixmapPrivateKeyIndex;
|
||||||
|
static int exaGCPrivateKeyIndex;
|
||||||
|
DevPrivateKey exaGCPrivateKey = &exaGCPrivateKeyIndex;
|
||||||
|
|
||||||
#ifdef MITSHM
|
#ifdef MITSHM
|
||||||
static ShmFuncs exaShmFuncs = { NULL, NULL };
|
static ShmFuncs exaShmFuncs = { NULL, NULL };
|
||||||
|
@ -661,6 +663,8 @@ static GCFuncs exaGCFuncs = {
|
||||||
static int
|
static int
|
||||||
exaCreateGC (GCPtr pGC)
|
exaCreateGC (GCPtr pGC)
|
||||||
{
|
{
|
||||||
|
ExaGCPriv(pGC);
|
||||||
|
|
||||||
if (!fbCreateGC (pGC))
|
if (!fbCreateGC (pGC))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -890,6 +894,13 @@ exaDriverInit (ScreenPtr pScreen,
|
||||||
|
|
||||||
exaDDXDriverInit(pScreen);
|
exaDDXDriverInit(pScreen);
|
||||||
|
|
||||||
|
if (!dixRequestPrivate(exaGCPrivateKey, sizeof(ExaGCPrivRec))) {
|
||||||
|
LogMessage(X_WARNING,
|
||||||
|
"EXA(%d): Failed to allocate GC private\n",
|
||||||
|
pScreen->myNum);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Replace various fb screen functions
|
* Replace various fb screen functions
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -173,9 +173,13 @@ typedef struct {
|
||||||
|
|
||||||
extern DevPrivateKey exaScreenPrivateKey;
|
extern DevPrivateKey exaScreenPrivateKey;
|
||||||
extern DevPrivateKey exaPixmapPrivateKey;
|
extern DevPrivateKey exaPixmapPrivateKey;
|
||||||
|
extern DevPrivateKey exaGCPrivateKey;
|
||||||
#define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)dixLookupPrivate(&(s)->devPrivates, exaScreenPrivateKey))
|
#define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)dixLookupPrivate(&(s)->devPrivates, exaScreenPrivateKey))
|
||||||
#define ExaScreenPriv(s) ExaScreenPrivPtr pExaScr = ExaGetScreenPriv(s)
|
#define ExaScreenPriv(s) ExaScreenPrivPtr pExaScr = ExaGetScreenPriv(s)
|
||||||
|
|
||||||
|
#define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixLookupPrivate(&(gc)->devPrivates, exaGCPrivateKey))
|
||||||
|
#define ExaGCPriv(gc) ExaGCPrivPtr pExaGC = ExaGetGCPriv(gc)
|
||||||
|
|
||||||
/** Align an offset to an arbitrary alignment */
|
/** Align an offset to an arbitrary alignment */
|
||||||
#define EXA_ALIGN(offset, align) (((offset) + (align) - 1) - \
|
#define EXA_ALIGN(offset, align) (((offset) + (align) - 1) - \
|
||||||
(((offset) + (align) - 1) % (align)))
|
(((offset) + (align) - 1) % (align)))
|
||||||
|
@ -237,6 +241,12 @@ typedef struct {
|
||||||
void *driverPriv;
|
void *driverPriv;
|
||||||
} ExaPixmapPrivRec, *ExaPixmapPrivPtr;
|
} ExaPixmapPrivRec, *ExaPixmapPrivPtr;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
/* GC values from the layer below. */
|
||||||
|
GCOps *ops;
|
||||||
|
GCFuncs *funcs;
|
||||||
|
} ExaGCPrivRec, *ExaGCPrivPtr;
|
||||||
|
|
||||||
typedef struct _ExaMigrationRec {
|
typedef struct _ExaMigrationRec {
|
||||||
Bool as_dst;
|
Bool as_dst;
|
||||||
Bool as_src;
|
Bool as_src;
|
||||||
|
|
Loading…
Reference in New Issue