Small changes to damage to match 1.4

Mostly just code cleanup... nothing "really" changing here...
This commit is contained in:
Jeremy Huddleston 2008-03-28 16:01:29 -07:00
parent 38cbd13490
commit 57308bbc9b
6 changed files with 20 additions and 60 deletions

View file

@ -1,6 +1,4 @@
/* /*
* $Id$
*
* Copyright © 2002 Keith Packard * Copyright © 2002 Keith Packard
* *
* Permission to use, copy, modify, distribute, and sell this software and its * Permission to use, copy, modify, distribute, and sell this software and its
@ -28,12 +26,12 @@
#include "damageextint.h" #include "damageextint.h"
unsigned char DamageReqCode; static unsigned char DamageReqCode;
int DamageEventBase; static int DamageEventBase;
int DamageErrorBase; static int DamageErrorBase;
int DamageClientPrivateIndex; static int DamageClientPrivateIndex;
RESTYPE DamageExtType; static RESTYPE DamageExtType;
RESTYPE DamageExtWinType; static RESTYPE DamageExtWinType;
/* Version of the damage extension supported by the server, as opposed to the /* Version of the damage extension supported by the server, as opposed to the
* DAMAGE_* defines from damageproto for what version the proto header * DAMAGE_* defines from damageproto for what version the proto header
@ -186,7 +184,7 @@ ProcDamageCreate (ClientPtr client)
REQUEST_SIZE_MATCH(xDamageCreateReq); REQUEST_SIZE_MATCH(xDamageCreateReq);
LEGAL_NEW_RESOURCE(stuff->damage, client); LEGAL_NEW_RESOURCE(stuff->damage, client);
SECURITY_VERIFY_DRAWABLE (pDrawable, stuff->drawable, client, SECURITY_VERIFY_DRAWABLE (pDrawable, stuff->drawable, client,
SecurityReadAccess); SecurityReadAccess);
switch (stuff->level) { switch (stuff->level) {
case XDamageReportRawRectangles: case XDamageReportRawRectangles:
level = DamageReportRawRegion; level = DamageReportRawRegion;
@ -311,7 +309,7 @@ static const int version_requests[] = {
#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0])) #define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0]))
int (*ProcDamageVector[XDamageNumberRequests])(ClientPtr) = { static int (*ProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
/*************** Version 1 ******************/ /*************** Version 1 ******************/
ProcDamageQueryVersion, ProcDamageQueryVersion,
ProcDamageCreate, ProcDamageCreate,
@ -400,7 +398,7 @@ SProcDamageAdd (ClientPtr client)
return (*ProcDamageVector[stuff->damageReqType]) (client); return (*ProcDamageVector[stuff->damageReqType]) (client);
} }
int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = { static int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
/*************** Version 1 ******************/ /*************** Version 1 ******************/
SProcDamageQueryVersion, SProcDamageQueryVersion,
SProcDamageCreate, SProcDamageCreate,
@ -470,7 +468,7 @@ FreeDamageExtWin (pointer value, XID wid)
return Success; return Success;
} }
void static void
SDamageNotifyEvent (xDamageNotifyEvent *from, SDamageNotifyEvent (xDamageNotifyEvent *from,
xDamageNotifyEvent *to) xDamageNotifyEvent *to)
{ {

View file

@ -1,6 +1,4 @@
/* /*
* $Id$
*
* Copyright © 2002 Keith Packard * Copyright © 2002 Keith Packard
* *
* Permission to use, copy, modify, distribute, and sell this software and its * Permission to use, copy, modify, distribute, and sell this software and its

View file

@ -1,6 +1,4 @@
/* /*
* $Id$
*
* Copyright © 2002 Keith Packard * Copyright © 2002 Keith Packard
* *
* Permission to use, copy, modify, distribute, and sell this software and its * Permission to use, copy, modify, distribute, and sell this software and its
@ -44,13 +42,6 @@
#include "damage.h" #include "damage.h"
#include "xfixes.h" #include "xfixes.h"
extern unsigned char DamageReqCode;
extern int DamageEventBase;
extern int DamageErrorBase;
extern int DamageClientPrivateIndex;
extern RESTYPE DamageExtType;
extern RESTYPE DamageExtWinType;
typedef struct _DamageClient { typedef struct _DamageClient {
CARD32 major_version; CARD32 major_version;
CARD32 minor_version; CARD32 minor_version;
@ -67,9 +58,6 @@ typedef struct _DamageExt {
XID id; XID id;
} DamageExtRec, *DamageExtPtr; } DamageExtRec, *DamageExtPtr;
extern int (*ProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
extern int (*SProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
#define VERIFY_DAMAGEEXT(pDamageExt, rid, client, mode) { \ #define VERIFY_DAMAGEEXT(pDamageExt, rid, client, mode) { \
pDamageExt = SecurityLookupIDByType (client, rid, DamageExtType, mode); \ pDamageExt = SecurityLookupIDByType (client, rid, DamageExtType, mode); \
if (!pDamageExt) { \ if (!pDamageExt) { \
@ -78,10 +66,6 @@ extern int (*SProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
} \ } \
} }
void
SDamageNotifyEvent (xDamageNotifyEvent *from,
xDamageNotifyEvent *to);
void void
DamageExtSetCritical (ClientPtr pClient, Bool critical); DamageExtSetCritical (ClientPtr pClient, Bool critical);

View file

@ -1,6 +1,4 @@
/* /*
* $Id$
*
* Copyright © 2003 Keith Packard * Copyright © 2003 Keith Packard
* *
* Permission to use, copy, modify, distribute, and sell this software and its * Permission to use, copy, modify, distribute, and sell this software and its
@ -72,6 +70,12 @@
#define pixmapDamage(pPixmap) damagePixPriv(pPixmap) #define pixmapDamage(pPixmap) damagePixPriv(pPixmap)
static int damageScrPrivateIndex;
static int damagePixPrivateIndex;
static int damageGCPrivateIndex;
static int damageWinPrivateIndex;
static int damageGeneration;
static DamagePtr * static DamagePtr *
getDrawableDamageRef (DrawablePtr pDrawable) getDrawableDamageRef (DrawablePtr pDrawable)
{ {
@ -368,12 +372,12 @@ static void damageChangeClip(GCPtr, int, pointer, int);
static void damageDestroyClip(GCPtr); static void damageDestroyClip(GCPtr);
static void damageCopyClip(GCPtr, GCPtr); static void damageCopyClip(GCPtr, GCPtr);
GCFuncs damageGCFuncs = { static GCFuncs damageGCFuncs = {
damageValidateGC, damageChangeGC, damageCopyGC, damageDestroyGC, damageValidateGC, damageChangeGC, damageCopyGC, damageDestroyGC,
damageChangeClip, damageDestroyClip, damageCopyClip damageChangeClip, damageDestroyClip, damageCopyClip
}; };
extern GCOps damageGCOps; static GCOps damageGCOps;
static Bool static Bool
damageCreateGC(GCPtr pGC) damageCreateGC(GCPtr pGC)
@ -1686,7 +1690,7 @@ damageCopyWindow(WindowPtr pWindow,
wrap (pScrPriv, pScreen, CopyWindow, damageCopyWindow); wrap (pScrPriv, pScreen, CopyWindow, damageCopyWindow);
} }
GCOps damageGCOps = { static GCOps damageGCOps = {
damageFillSpans, damageSetSpans, damageFillSpans, damageSetSpans,
damagePutImage, damageCopyArea, damagePutImage, damageCopyArea,
damageCopyPlane, damagePolyPoint, damageCopyPlane, damagePolyPoint,
@ -1787,12 +1791,6 @@ damageCloseScreen (int i, ScreenPtr pScreen)
return (*pScreen->CloseScreen) (i, pScreen); return (*pScreen->CloseScreen) (i, pScreen);
} }
int damageScrPrivateIndex;
int damagePixPrivateIndex;
int damageGCPrivateIndex;
int damageWinPrivateIndex;
int damageGeneration;
Bool Bool
DamageSetup (ScreenPtr pScreen) DamageSetup (ScreenPtr pScreen)
{ {
@ -1831,16 +1829,6 @@ DamageSetup (ScreenPtr pScreen)
if (!pScrPriv) if (!pScrPriv)
return FALSE; return FALSE;
#ifdef COMPOSITE
/* This is a kludge to ensure wrapping order with the composite wrapper.
* If it's done from compinit.c, then DamageSetup may be called before the
* extension init phase, so that cw will be higher in the wrapping chain and
* rewrite drawables before damage gets to it, causing confusion.
*/
if (!noCompositeExtension)
miInitializeCompositeWrapper (pScreen);
#endif
pScrPriv->internalLevel = 0; pScrPriv->internalLevel = 0;
pScrPriv->pScreenDamage = 0; pScrPriv->pScreenDamage = 0;

View file

@ -1,6 +1,4 @@
/* /*
* $Id$
*
* Copyright © 2003 Keith Packard * Copyright © 2003 Keith Packard
* *
* Permission to use, copy, modify, distribute, and sell this software and its * Permission to use, copy, modify, distribute, and sell this software and its

View file

@ -1,6 +1,4 @@
/* /*
* $Id$
*
* Copyright © 2003 Keith Packard * Copyright © 2003 Keith Packard
* *
* Permission to use, copy, modify, distribute, and sell this software and its * Permission to use, copy, modify, distribute, and sell this software and its
@ -82,11 +80,7 @@ typedef struct _damageGCPriv {
GCFuncs *funcs; GCFuncs *funcs;
} DamageGCPrivRec, *DamageGCPrivPtr; } DamageGCPrivRec, *DamageGCPrivPtr;
extern int damageScrPrivateIndex; /* XXX should move these into damage.c, damageScrPrivateIndex is static */
extern int damagePixPrivateIndex;
extern int damageGCPrivateIndex;
extern int damageWinPrivateIndex;
#define damageGetScrPriv(pScr) \ #define damageGetScrPriv(pScr) \
((DamageScrPrivPtr) (pScr)->devPrivates[damageScrPrivateIndex].ptr) ((DamageScrPrivPtr) (pScr)->devPrivates[damageScrPrivateIndex].ptr)