2 * Copyright © 2003 Keith Packard
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of Keith Packard not be used in
9 * advertising or publicity pertaining to distribution of the software without
10 * specific, written prior permission. Keith Packard makes no
11 * representations about the suitability of this software for any purpose. It
12 * is provided "as is" without express or implied warranty.
14 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20 * PERFORMANCE OF THIS SOFTWARE.
23 #ifdef HAVE_DIX_CONFIG_H
24 #include <dix-config.h>
33 #include "picturestr.h"
35 typedef struct _damage {
40 DamageReportLevel damageLevel;
44 DrawablePtr pDrawable;
46 DamageReportFunc damageReport;
47 DamageReportFunc damageReportPostRendering;
48 DamageDestroyFunc damageDestroy;
49 DamageMarkerFunc damageMarker;
52 RegionRec pendingDamage; /* will be flushed post submission at the latest */
53 RegionRec backupDamage; /* for use with damageMarker */
55 PrivateRec *devPrivates;
58 typedef struct _damageScrPriv {
62 * For DDXen which don't provide GetScreenPixmap, this provides
63 * a place to hook damage for windows on the screen
65 DamagePtr pScreenDamage;
67 CopyWindowProcPtr CopyWindow;
68 CloseScreenProcPtr CloseScreen;
69 CreateGCProcPtr CreateGC;
70 DestroyPixmapProcPtr DestroyPixmap;
71 SetWindowPixmapProcPtr SetWindowPixmap;
72 DestroyWindowProcPtr DestroyWindow;
73 CompositeProcPtr Composite;
75 AddTrapsProcPtr AddTraps;
77 /* Table of wrappable function pointers */
78 DamageScreenFuncsRec funcs;
79 } DamageScrPrivRec, *DamageScrPrivPtr;
81 typedef struct _damageGCPriv {
84 } DamageGCPrivRec, *DamageGCPrivPtr;
86 /* XXX should move these into damage.c, damageScrPrivateIndex is static */
87 #define damageGetScrPriv(pScr) ((DamageScrPrivPtr) \
88 dixLookupPrivate(&(pScr)->devPrivates, damageScrPrivateKey))
90 #define damageScrPriv(pScr) \
91 DamageScrPrivPtr pScrPriv = damageGetScrPriv(pScr)
93 #define damageGetPixPriv(pPix) \
94 dixLookupPrivate(&(pPix)->devPrivates, damagePixPrivateKey)
96 #define damgeSetPixPriv(pPix,v) \
97 dixSetPrivate(&(pPix)->devPrivates, damagePixPrivateKey, v)
99 #define damagePixPriv(pPix) \
100 DamagePtr pDamage = damageGetPixPriv(pPix)
102 #define damageGetGCPriv(pGC) \
103 dixLookupPrivate(&(pGC)->devPrivates, damageGCPrivateKey)
105 #define damageGCPriv(pGC) \
106 DamageGCPrivPtr pGCPriv = damageGetGCPriv(pGC)
108 #define damageGetWinPriv(pWin) \
109 ((DamagePtr)dixLookupPrivate(&(pWin)->devPrivates, damageWinPrivateKey))
111 #define damageSetWinPriv(pWin,d) \
112 dixSetPrivate(&(pWin)->devPrivates, damageWinPrivateKey, d)
114 #endif /* _DAMAGESTR_H_ */