1 | /*
|
---|
2 | * Copyright © 2004 Eric Anholt
|
---|
3 | *
|
---|
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 Eric Anholt not be used in
|
---|
9 | * advertising or publicity pertaining to distribution of the software without
|
---|
10 | * specific, written prior permission. Eric Anholt makes no
|
---|
11 | * representations about the suitability of this software for any purpose. It
|
---|
12 | * is provided "as is" without express or implied warranty.
|
---|
13 | *
|
---|
14 | * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
---|
15 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
---|
16 | * EVENT SHALL ERIC ANHOLT 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.
|
---|
21 | */
|
---|
22 | /* $Header: /cvs/xorg/xserver/xorg/miext/cw/cw.h,v 1.14 2005/12/09 18:32:46 ajax Exp $ */
|
---|
23 |
|
---|
24 | #ifdef HAVE_DIX_CONFIG_H
|
---|
25 | #include <dix-config.h>
|
---|
26 | #endif
|
---|
27 |
|
---|
28 | #include "gcstruct.h"
|
---|
29 | #include "picturestr.h"
|
---|
30 |
|
---|
31 | /*
|
---|
32 | * One of these structures is allocated per GC that gets used with a window with
|
---|
33 | * backing pixmap.
|
---|
34 | */
|
---|
35 |
|
---|
36 | typedef struct {
|
---|
37 | GCPtr pBackingGC; /* Copy of the GC but with graphicsExposures
|
---|
38 | * set FALSE and the clientClip set to
|
---|
39 | * clip output to the valid regions of the
|
---|
40 | * backing pixmap. */
|
---|
41 | unsigned long serialNumber; /* clientClip computed time */
|
---|
42 | unsigned long stateChanges; /* changes in parent gc since last copy */
|
---|
43 | GCOps *wrapOps; /* wrapped ops */
|
---|
44 | GCFuncs *wrapFuncs; /* wrapped funcs */
|
---|
45 | } cwGCRec, *cwGCPtr;
|
---|
46 |
|
---|
47 | extern int cwGCIndex;
|
---|
48 |
|
---|
49 | #define getCwGC(pGC) ((cwGCPtr)(pGC)->devPrivates[cwGCIndex].ptr)
|
---|
50 | #define setCwGC(pGC,p) ((pGC)->devPrivates[cwGCIndex].ptr = (pointer) (p))
|
---|
51 |
|
---|
52 | /*
|
---|
53 | * One of these structures is allocated per Picture that gets used with a
|
---|
54 | * window with a backing pixmap
|
---|
55 | */
|
---|
56 |
|
---|
57 | typedef struct {
|
---|
58 | PicturePtr pBackingPicture;
|
---|
59 | unsigned long serialNumber;
|
---|
60 | unsigned long stateChanges;
|
---|
61 | } cwPictureRec, *cwPicturePtr;
|
---|
62 |
|
---|
63 | #define getCwPicture(pPicture) ((cwPicturePtr)(pPicture)->devPrivates[cwPictureIndex].ptr)
|
---|
64 | #define setCwPicture(pPicture,p) ((pPicture)->devPrivates[cwPictureIndex].ptr = (pointer) (p))
|
---|
65 |
|
---|
66 | extern int cwPictureIndex;
|
---|
67 |
|
---|
68 | extern int cwWindowIndex;
|
---|
69 |
|
---|
70 | #define cwWindowPrivate(pWindow) ((pWindow)->devPrivates[cwWindowIndex].ptr)
|
---|
71 | #define getCwPixmap(pWindow) ((PixmapPtr) cwWindowPrivate(pWindow))
|
---|
72 | #define setCwPixmap(pWindow,pPixmap) (cwWindowPrivate(pWindow) = (pointer) (pPixmap))
|
---|
73 |
|
---|
74 | #define cwDrawableIsRedirWindow(pDraw) \
|
---|
75 | ((pDraw)->type == DRAWABLE_WINDOW && \
|
---|
76 | getCwPixmap((WindowPtr) (pDraw)) != NULL)
|
---|
77 |
|
---|
78 | typedef struct {
|
---|
79 | /*
|
---|
80 | * screen func wrappers
|
---|
81 | */
|
---|
82 | CloseScreenProcPtr CloseScreen;
|
---|
83 | GetImageProcPtr GetImage;
|
---|
84 | GetSpansProcPtr GetSpans;
|
---|
85 | CreateGCProcPtr CreateGC;
|
---|
86 |
|
---|
87 | PaintWindowBackgroundProcPtr PaintWindowBackground;
|
---|
88 | PaintWindowBorderProcPtr PaintWindowBorder;
|
---|
89 | CopyWindowProcPtr CopyWindow;
|
---|
90 |
|
---|
91 | GetWindowPixmapProcPtr GetWindowPixmap;
|
---|
92 | SetWindowPixmapProcPtr SetWindowPixmap;
|
---|
93 |
|
---|
94 | #ifdef RENDER
|
---|
95 | DestroyPictureProcPtr DestroyPicture;
|
---|
96 | ChangePictureClipProcPtr ChangePictureClip;
|
---|
97 | DestroyPictureClipProcPtr DestroyPictureClip;
|
---|
98 |
|
---|
99 | ChangePictureProcPtr ChangePicture;
|
---|
100 | ValidatePictureProcPtr ValidatePicture;
|
---|
101 |
|
---|
102 | CompositeProcPtr Composite;
|
---|
103 | GlyphsProcPtr Glyphs;
|
---|
104 | CompositeRectsProcPtr CompositeRects;
|
---|
105 |
|
---|
106 | TrapezoidsProcPtr Trapezoids;
|
---|
107 | TrianglesProcPtr Triangles;
|
---|
108 | TriStripProcPtr TriStrip;
|
---|
109 | TriFanProcPtr TriFan;
|
---|
110 |
|
---|
111 | RasterizeTrapezoidProcPtr RasterizeTrapezoid;
|
---|
112 | #endif
|
---|
113 | } cwScreenRec, *cwScreenPtr;
|
---|
114 |
|
---|
115 | extern int cwScreenIndex;
|
---|
116 |
|
---|
117 | #define getCwScreen(pScreen) ((cwScreenPtr)(pScreen)->devPrivates[cwScreenIndex].ptr)
|
---|
118 | #define setCwScreen(pScreen,p) ((cwScreenPtr)(pScreen)->devPrivates[cwScreenIndex].ptr = (p))
|
---|
119 |
|
---|
120 | #define CW_OFFSET_XYPOINTS(ppt, npt) do { \
|
---|
121 | DDXPointPtr _ppt = (DDXPointPtr)(ppt); \
|
---|
122 | int _i; \
|
---|
123 | for (_i = 0; _i < npt; _i++) { \
|
---|
124 | _ppt[_i].x += dst_off_x; \
|
---|
125 | _ppt[_i].y += dst_off_y; \
|
---|
126 | } \
|
---|
127 | } while (0)
|
---|
128 |
|
---|
129 | #define CW_OFFSET_RECTS(prect, nrect) do { \
|
---|
130 | int _i; \
|
---|
131 | for (_i = 0; _i < nrect; _i++) { \
|
---|
132 | (prect)[_i].x += dst_off_x; \
|
---|
133 | (prect)[_i].y += dst_off_y; \
|
---|
134 | } \
|
---|
135 | } while (0)
|
---|
136 |
|
---|
137 | #define CW_OFFSET_ARCS(parc, narc) do { \
|
---|
138 | int _i; \
|
---|
139 | for (_i = 0; _i < narc; _i++) { \
|
---|
140 | (parc)[_i].x += dst_off_x; \
|
---|
141 | (parc)[_i].y += dst_off_y; \
|
---|
142 | } \
|
---|
143 | } while (0)
|
---|
144 |
|
---|
145 | #define CW_OFFSET_XY_DST(x, y) do { \
|
---|
146 | (x) = (x) + dst_off_x; \
|
---|
147 | (y) = (y) + dst_off_y; \
|
---|
148 | } while (0)
|
---|
149 |
|
---|
150 | #define CW_OFFSET_XY_SRC(x, y) do { \
|
---|
151 | (x) = (x) + src_off_x; \
|
---|
152 | (y) = (y) + src_off_y; \
|
---|
153 | } while (0)
|
---|
154 |
|
---|
155 | /* cw.c */
|
---|
156 | DrawablePtr
|
---|
157 | cwGetBackingDrawable(DrawablePtr pDrawable, int *x_off, int *y_off);
|
---|
158 |
|
---|
159 | /* cw_render.c */
|
---|
160 |
|
---|
161 | void
|
---|
162 | cwInitializeRender (ScreenPtr pScreen);
|
---|
163 |
|
---|
164 | void
|
---|
165 | cwFiniRender (ScreenPtr pScreen);
|
---|
166 |
|
---|
167 | /* cw.c */
|
---|
168 |
|
---|
169 | void
|
---|
170 | miInitializeCompositeWrapper(ScreenPtr pScreen);
|
---|
171 |
|
---|
172 | /* Must be called before miInitializeCompositeWrapper */
|
---|
173 | void
|
---|
174 | miDisableCompositeWrapper(ScreenPtr pScreen);
|
---|