3
* Copyright (C) 2000 Keith Packard, member of The XFree86 Project, Inc.
4
* 2005 Zack Rusin, Trolltech
6
* Permission to use, copy, modify, distribute, and sell this software and its
7
* documentation for any purpose is hereby granted without fee, provided that
8
* the above copyright notice appear in all copies and that both that
9
* copyright notice and this permission notice appear in supporting
10
* documentation, and that the name of Keith Packard not be used in
11
* advertising or publicity pertaining to distribution of the software without
12
* specific, written prior permission. Keith Packard makes no
13
* representations about the suitability of this software for any purpose. It
14
* is provided "as is" without express or implied warranty.
16
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
17
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
18
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
19
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
20
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
21
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
22
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
29
#ifdef HAVE_XORG_CONFIG_H
30
#include <xorg-config.h>
37
#include <X11/Xproto.h>
38
#include "scrnintstr.h"
39
#include "pixmapstr.h"
40
#include "windowstr.h"
43
#include "colormapst.h"
46
#include "mipointer.h"
50
#include "fboverlay.h"
55
#define DEBUG_TRACE_FALL 0
56
#define DEBUG_MIGRATE 0
57
#define DEBUG_PIXMAP 0
58
#define DEBUG_OFFSCREEN 0
61
#define EXA_FALLBACK(x) \
63
ErrorF("EXA fallback at %s: ", __FUNCTION__); \
67
#define EXA_FALLBACK(x)
71
#define EXA_MAX_FB FB_OVERLAY_MAX
74
typedef void (*EnableDisableFBAccessProcPtr)(int, Bool);
77
CreateGCProcPtr SavedCreateGC;
78
CloseScreenProcPtr SavedCloseScreen;
79
GetImageProcPtr SavedGetImage;
80
GetSpansProcPtr SavedGetSpans;
81
PaintWindowBackgroundProcPtr SavedPaintWindowBackground;
82
CreatePixmapProcPtr SavedCreatePixmap;
83
DestroyPixmapProcPtr SavedDestroyPixmap;
84
PaintWindowBorderProcPtr SavedPaintWindowBorder;
85
CopyWindowProcPtr SavedCopyWindow;
87
CompositeProcPtr SavedComposite;
88
GlyphsProcPtr SavedGlyphs;
90
EnableDisableFBAccessProcPtr SavedEnableDisableFBAccess;
91
Bool wrappedEnableDisableFB;
93
} ExaScreenPrivRec, *ExaScreenPrivPtr;
96
* This is the only completely portable way to
100
#define BitsPerPixel(d) (\
101
PixmapWidthPaddingInfo[d].notPower2 ? \
102
(PixmapWidthPaddingInfo[d].bytesPerPixel * 8) : \
103
((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \
104
(PixmapWidthPaddingInfo[d].padRoundUp+1)))
107
extern int exaScreenPrivateIndex;
108
extern int exaPixmapPrivateIndex;
109
#define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)(s)->devPrivates[exaScreenPrivateIndex].ptr)
110
#define ExaScreenPriv(s) ExaScreenPrivPtr pExaScr = ExaGetScreenPriv(s)
112
#define ExaGetPixmapPriv(p) ((ExaPixmapPrivPtr)(p)->devPrivates[exaPixmapPrivateIndex].ptr)
113
#define ExaSetPixmapPriv(p,a) ((p)->devPrivates[exaPixmapPrivateIndex].ptr = (pointer) (a))
114
#define ExaPixmapPriv(p) ExaPixmapPrivPtr pExaPixmap = ExaGetPixmapPriv(p)
117
ExaOffscreenArea *area;
122
/* If area is NULL, then dirty == TRUE means that the pixmap has been
123
* modified, so the contents are defined. Used to avoid uploads of
125
* If area is non-NULL, then dirty == TRUE means that the in-framebuffer
126
* copy has been changed from the system-memory copy. Used to avoid
127
* downloads of unmodified data.
131
} ExaPixmapPrivRec, *ExaPixmapPrivPtr;
136
ExaCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans,
137
DDXPointPtr ppt, int *pwidth, int fSorted);
140
ExaCheckSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc,
141
DDXPointPtr ppt, int *pwidth, int nspans, int fSorted);
144
ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
145
int x, int y, int w, int h, int leftPad, int format,
149
ExaCheckCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
150
int srcx, int srcy, int w, int h, int dstx, int dsty);
153
ExaCheckCopyPlane (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
154
int srcx, int srcy, int w, int h, int dstx, int dsty,
155
unsigned long bitPlane);
158
ExaCheckPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
159
DDXPointPtr pptInit);
162
ExaCheckPolylines (DrawablePtr pDrawable, GCPtr pGC,
163
int mode, int npt, DDXPointPtr ppt);
166
ExaCheckPolySegment (DrawablePtr pDrawable, GCPtr pGC,
167
int nsegInit, xSegment *pSegInit);
170
ExaCheckPolyRectangle (DrawablePtr pDrawable, GCPtr pGC,
171
int nrects, xRectangle *prect);
174
ExaCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC,
175
int narcs, xArc *pArcs);
177
#define ExaCheckFillPolygon miFillPolygon
180
ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
181
int nrect, xRectangle *prect);
184
ExaCheckPolyFillArc (DrawablePtr pDrawable, GCPtr pGC,
185
int narcs, xArc *pArcs);
188
ExaCheckImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
189
int x, int y, unsigned int nglyph,
190
CharInfoPtr *ppci, pointer pglyphBase);
193
ExaCheckPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
194
int x, int y, unsigned int nglyph,
195
CharInfoPtr *ppci, pointer pglyphBase);
198
ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap,
199
DrawablePtr pDrawable,
200
int w, int h, int x, int y);
203
ExaCheckGetImage (DrawablePtr pDrawable,
204
int x, int y, int w, int h,
205
unsigned int format, unsigned long planeMask,
209
ExaCheckGetSpans (DrawablePtr pDrawable,
217
ExaCheckSaveAreas (PixmapPtr pPixmap,
224
ExaCheckRestoreAreas (PixmapPtr pPixmap,
231
ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what);
233
extern const GCOps exaAsyncPixmapGCOps;
237
ExaCheckComposite (CARD8 op,
253
ExaOffscreenMarkUsed (PixmapPtr pPixmap);
256
ExaOffscreenSwapOut (ScreenPtr pScreen);
259
ExaOffscreenSwapIn (ScreenPtr pScreen);
262
ExaOffscreenFini (ScreenPtr pScreen);
265
exaEnableDisableFBAccess (int index, Bool enable);
269
exaDrawableUseScreen(DrawablePtr pDrawable);
272
exaDrawableUseMemory(DrawablePtr pDrawable);
275
exaPixmapUseScreen (PixmapPtr pPixmap);
278
exaPixmapUseMemory (PixmapPtr pPixmap);
281
exaPrepareAccess(DrawablePtr pDrawable, int index);
284
exaFinishAccess(DrawablePtr pDrawable, int index);
287
exaDrawableDirty(DrawablePtr pDrawable);
290
exaDrawableIsOffscreen (DrawablePtr pDrawable);
293
exaPixmapIsOffscreen(PixmapPtr p);
296
exaGetOffscreenPixmap (DrawablePtr pDrawable, int *xp, int *yp);
299
exaMoveInPixmap (PixmapPtr pPixmap);
302
exaCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC,
303
int srcx, int srcy, int width, int height, int dstx, int dsty);
306
exaCopyNtoN (DrawablePtr pSrcDrawable,
307
DrawablePtr pDstDrawable,
319
exaComposite(CARD8 op,
336
PictFormatPtr maskFormat,
343
#endif /* EXAPRIV_H */