1 | /*
|
---|
2 | *
|
---|
3 | * Copyright © 1998 Keith Packard
|
---|
4 | *
|
---|
5 | * Permission to use, copy, modify, distribute, and sell this software and its
|
---|
6 | * documentation for any purpose is hereby granted without fee, provided that
|
---|
7 | * the above copyright notice appear in all copies and that both that
|
---|
8 | * copyright notice and this permission notice appear in supporting
|
---|
9 | * documentation, and that the name of Keith Packard not be used in
|
---|
10 | * advertising or publicity pertaining to distribution of the software without
|
---|
11 | * specific, written prior permission. Keith Packard makes no
|
---|
12 | * representations about the suitability of this software for any purpose. It
|
---|
13 | * is provided "as is" without express or implied warranty.
|
---|
14 | *
|
---|
15 | * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
---|
16 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
---|
17 | * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
---|
18 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
---|
19 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
---|
20 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
---|
21 | * PERFORMANCE OF THIS SOFTWARE.
|
---|
22 | */
|
---|
23 |
|
---|
24 | #ifndef _FB_H_
|
---|
25 | #define _FB_H_
|
---|
26 |
|
---|
27 | #include <X11/X.h>
|
---|
28 | #include <pixman.h>
|
---|
29 |
|
---|
30 | #include "scrnintstr.h"
|
---|
31 | #include "pixmap.h"
|
---|
32 | #include "pixmapstr.h"
|
---|
33 | #include "region.h"
|
---|
34 | #include "gcstruct.h"
|
---|
35 | #include "colormap.h"
|
---|
36 | #include "miscstruct.h"
|
---|
37 | #include "servermd.h"
|
---|
38 | #include "windowstr.h"
|
---|
39 | #include "privates.h"
|
---|
40 | #include "mi.h"
|
---|
41 | #include "migc.h"
|
---|
42 | #include "picturestr.h"
|
---|
43 |
|
---|
44 | #ifdef FB_ACCESS_WRAPPER
|
---|
45 |
|
---|
46 | #include "wfbrename.h"
|
---|
47 | #define FBPREFIX(x) wfb##x
|
---|
48 | #define WRITE(ptr, val) ((*wfbWriteMemory)((ptr), (val), sizeof(*(ptr))))
|
---|
49 | #define READ(ptr) ((*wfbReadMemory)((ptr), sizeof(*(ptr))))
|
---|
50 |
|
---|
51 | #define MEMCPY_WRAPPED(dst, src, size) do { \
|
---|
52 | size_t _i; \
|
---|
53 | CARD8 *_dst = (CARD8*)(dst), *_src = (CARD8*)(src); \
|
---|
54 | for(_i = 0; _i < size; _i++) { \
|
---|
55 | WRITE(_dst +_i, READ(_src + _i)); \
|
---|
56 | } \
|
---|
57 | } while(0)
|
---|
58 |
|
---|
59 | #define MEMSET_WRAPPED(dst, val, size) do { \
|
---|
60 | size_t _i; \
|
---|
61 | CARD8 *_dst = (CARD8*)(dst); \
|
---|
62 | for(_i = 0; _i < size; _i++) { \
|
---|
63 | WRITE(_dst +_i, (val)); \
|
---|
64 | } \
|
---|
65 | } while(0)
|
---|
66 |
|
---|
67 | #else
|
---|
68 |
|
---|
69 | #define FBPREFIX(x) fb##x
|
---|
70 | #define WRITE(ptr, val) (*(ptr) = (val))
|
---|
71 | #define READ(ptr) (*(ptr))
|
---|
72 | #define MEMCPY_WRAPPED(dst, src, size) memcpy((dst), (src), (size))
|
---|
73 | #define MEMSET_WRAPPED(dst, val, size) memset((dst), (val), (size))
|
---|
74 |
|
---|
75 | #endif
|
---|
76 |
|
---|
77 | /*
|
---|
78 | * This single define controls the basic size of data manipulated
|
---|
79 | * by this software; it must be log2(sizeof (FbBits) * 8)
|
---|
80 | */
|
---|
81 |
|
---|
82 | #ifndef FB_SHIFT
|
---|
83 | #define FB_SHIFT LOG2_BITMAP_PAD
|
---|
84 | #endif
|
---|
85 |
|
---|
86 | #define FB_UNIT (1 << FB_SHIFT)
|
---|
87 | #define FB_MASK (FB_UNIT - 1)
|
---|
88 | #define FB_ALLONES ((FbBits) -1)
|
---|
89 | #if GLYPHPADBYTES != 4
|
---|
90 | #error "GLYPHPADBYTES must be 4"
|
---|
91 | #endif
|
---|
92 | /* for driver compat - intel UXA needs the second one at least */
|
---|
93 | #define FB_24BIT
|
---|
94 | #define FB_24_32BIT
|
---|
95 | #define FB_STIP_SHIFT LOG2_BITMAP_PAD
|
---|
96 | #define FB_STIP_UNIT (1 << FB_STIP_SHIFT)
|
---|
97 | #define FB_STIP_MASK (FB_STIP_UNIT - 1)
|
---|
98 | #define FB_STIP_ALLONES ((FbStip) -1)
|
---|
99 | #define FB_STIP_ODDSTRIDE(s) (((s) & (FB_MASK >> FB_STIP_SHIFT)) != 0)
|
---|
100 | #define FB_STIP_ODDPTR(p) ((((long) (p)) & (FB_MASK >> 3)) != 0)
|
---|
101 | #define FbStipStrideToBitsStride(s) (((s) >> (FB_SHIFT - FB_STIP_SHIFT)))
|
---|
102 | #define FbBitsStrideToStipStride(s) (((s) << (FB_SHIFT - FB_STIP_SHIFT)))
|
---|
103 | #define FbFullMask(n) ((n) == FB_UNIT ? FB_ALLONES : ((((FbBits) 1) << n) - 1))
|
---|
104 |
|
---|
105 | #if FB_SHIFT == 5
|
---|
106 | typedef CARD32 FbBits;
|
---|
107 | #else
|
---|
108 | #error "Unsupported FB_SHIFT"
|
---|
109 | #endif
|
---|
110 |
|
---|
111 | #if LOG2_BITMAP_PAD == FB_SHIFT
|
---|
112 | typedef FbBits FbStip;
|
---|
113 | #endif
|
---|
114 |
|
---|
115 | typedef int FbStride;
|
---|
116 |
|
---|
117 | #ifdef FB_DEBUG
|
---|
118 | extern _X_EXPORT void fbValidateDrawable(DrawablePtr d);
|
---|
119 | extern _X_EXPORT void fbInitializeDrawable(DrawablePtr d);
|
---|
120 | extern _X_EXPORT void fbSetBits(FbStip * bits, int stride, FbStip data);
|
---|
121 |
|
---|
122 | #define FB_HEAD_BITS (FbStip) (0xbaadf00d)
|
---|
123 | #define FB_TAIL_BITS (FbStip) (0xbaddf0ad)
|
---|
124 | #else
|
---|
125 | #define fbValidateDrawable(d)
|
---|
126 | #define fdInitializeDrawable(d)
|
---|
127 | #endif
|
---|
128 |
|
---|
129 | #include "fbrop.h"
|
---|
130 |
|
---|
131 | #if BITMAP_BIT_ORDER == LSBFirst
|
---|
132 | #define FbScrLeft(x,n) ((x) >> (n))
|
---|
133 | #define FbScrRight(x,n) ((x) << (n))
|
---|
134 | /* #define FbLeftBits(x,n) ((x) & ((((FbBits) 1) << (n)) - 1)) */
|
---|
135 | #define FbLeftStipBits(x,n) ((x) & ((((FbStip) 1) << (n)) - 1))
|
---|
136 | #define FbStipMoveLsb(x,s,n) (FbStipRight (x,(s)-(n)))
|
---|
137 | #define FbPatternOffsetBits 0
|
---|
138 | #else
|
---|
139 | #define FbScrLeft(x,n) ((x) << (n))
|
---|
140 | #define FbScrRight(x,n) ((x) >> (n))
|
---|
141 | /* #define FbLeftBits(x,n) ((x) >> (FB_UNIT - (n))) */
|
---|
142 | #define FbLeftStipBits(x,n) ((x) >> (FB_STIP_UNIT - (n)))
|
---|
143 | #define FbStipMoveLsb(x,s,n) (x)
|
---|
144 | #define FbPatternOffsetBits (sizeof (FbBits) - 1)
|
---|
145 | #endif
|
---|
146 |
|
---|
147 | #include "micoord.h"
|
---|
148 |
|
---|
149 | #define FbStipLeft(x,n) FbScrLeft(x,n)
|
---|
150 | #define FbStipRight(x,n) FbScrRight(x,n)
|
---|
151 |
|
---|
152 | #define FbRotLeft(x,n) FbScrLeft(x,n) | (n ? FbScrRight(x,FB_UNIT-n) : 0)
|
---|
153 | #define FbRotRight(x,n) FbScrRight(x,n) | (n ? FbScrLeft(x,FB_UNIT-n) : 0)
|
---|
154 |
|
---|
155 | #define FbRotStipLeft(x,n) FbStipLeft(x,n) | (n ? FbStipRight(x,FB_STIP_UNIT-n) : 0)
|
---|
156 | #define FbRotStipRight(x,n) FbStipRight(x,n) | (n ? FbStipLeft(x,FB_STIP_UNIT-n) : 0)
|
---|
157 |
|
---|
158 | #define FbLeftMask(x) ( ((x) & FB_MASK) ? \
|
---|
159 | FbScrRight(FB_ALLONES,(x) & FB_MASK) : 0)
|
---|
160 | #define FbRightMask(x) ( ((FB_UNIT - (x)) & FB_MASK) ? \
|
---|
161 | FbScrLeft(FB_ALLONES,(FB_UNIT - (x)) & FB_MASK) : 0)
|
---|
162 |
|
---|
163 | #define FbLeftStipMask(x) ( ((x) & FB_STIP_MASK) ? \
|
---|
164 | FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) : 0)
|
---|
165 | #define FbRightStipMask(x) ( ((FB_STIP_UNIT - (x)) & FB_STIP_MASK) ? \
|
---|
166 | FbScrLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - (x)) & FB_STIP_MASK) : 0)
|
---|
167 |
|
---|
168 | #define FbBitsMask(x,w) (FbScrRight(FB_ALLONES,(x) & FB_MASK) & \
|
---|
169 | FbScrLeft(FB_ALLONES,(FB_UNIT - ((x) + (w))) & FB_MASK))
|
---|
170 |
|
---|
171 | #define FbStipMask(x,w) (FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) & \
|
---|
172 | FbStipLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - ((x)+(w))) & FB_STIP_MASK))
|
---|
173 |
|
---|
174 | #define FbMaskBits(x,w,l,n,r) { \
|
---|
175 | n = (w); \
|
---|
176 | r = FbRightMask((x)+n); \
|
---|
177 | l = FbLeftMask(x); \
|
---|
178 | if (l) { \
|
---|
179 | n -= FB_UNIT - ((x) & FB_MASK); \
|
---|
180 | if (n < 0) { \
|
---|
181 | n = 0; \
|
---|
182 | l &= r; \
|
---|
183 | r = 0; \
|
---|
184 | } \
|
---|
185 | } \
|
---|
186 | n >>= FB_SHIFT; \
|
---|
187 | }
|
---|
188 |
|
---|
189 | #define FbByteMaskInvalid 0x10
|
---|
190 |
|
---|
191 | #define FbPatternOffset(o,t) ((o) ^ (FbPatternOffsetBits & ~(sizeof (t) - 1)))
|
---|
192 |
|
---|
193 | #define FbPtrOffset(p,o,t) ((t *) ((CARD8 *) (p) + (o)))
|
---|
194 | #define FbSelectPatternPart(xor,o,t) ((xor) >> (FbPatternOffset (o,t) << 3))
|
---|
195 | #define FbStorePart(dst,off,t,xor) (WRITE(FbPtrOffset(dst,off,t), \
|
---|
196 | FbSelectPart(xor,off,t)))
|
---|
197 | #ifndef FbSelectPart
|
---|
198 | #define FbSelectPart(x,o,t) FbSelectPatternPart(x,o,t)
|
---|
199 | #endif
|
---|
200 |
|
---|
201 | #define FbMaskBitsBytes(x,w,copy,l,lb,n,r,rb) { \
|
---|
202 | n = (w); \
|
---|
203 | lb = 0; \
|
---|
204 | rb = 0; \
|
---|
205 | r = FbRightMask((x)+n); \
|
---|
206 | if (r) { \
|
---|
207 | /* compute right byte length */ \
|
---|
208 | if ((copy) && (((x) + n) & 7) == 0) { \
|
---|
209 | rb = (((x) + n) & FB_MASK) >> 3; \
|
---|
210 | } else { \
|
---|
211 | rb = FbByteMaskInvalid; \
|
---|
212 | } \
|
---|
213 | } \
|
---|
214 | l = FbLeftMask(x); \
|
---|
215 | if (l) { \
|
---|
216 | /* compute left byte length */ \
|
---|
217 | if ((copy) && ((x) & 7) == 0) { \
|
---|
218 | lb = ((x) & FB_MASK) >> 3; \
|
---|
219 | } else { \
|
---|
220 | lb = FbByteMaskInvalid; \
|
---|
221 | } \
|
---|
222 | /* subtract out the portion painted by leftMask */ \
|
---|
223 | n -= FB_UNIT - ((x) & FB_MASK); \
|
---|
224 | if (n < 0) { \
|
---|
225 | if (lb != FbByteMaskInvalid) { \
|
---|
226 | if (rb == FbByteMaskInvalid) { \
|
---|
227 | lb = FbByteMaskInvalid; \
|
---|
228 | } else if (rb) { \
|
---|
229 | lb |= (rb - lb) << (FB_SHIFT - 3); \
|
---|
230 | rb = 0; \
|
---|
231 | } \
|
---|
232 | } \
|
---|
233 | n = 0; \
|
---|
234 | l &= r; \
|
---|
235 | r = 0; \
|
---|
236 | }\
|
---|
237 | } \
|
---|
238 | n >>= FB_SHIFT; \
|
---|
239 | }
|
---|
240 |
|
---|
241 | #define FbDoLeftMaskByteRRop(dst,lb,l,and,xor) { \
|
---|
242 | switch (lb) { \
|
---|
243 | case (sizeof (FbBits) - 3) | (1 << (FB_SHIFT - 3)): \
|
---|
244 | FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \
|
---|
245 | break; \
|
---|
246 | case (sizeof (FbBits) - 3) | (2 << (FB_SHIFT - 3)): \
|
---|
247 | FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \
|
---|
248 | FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
|
---|
249 | break; \
|
---|
250 | case (sizeof (FbBits) - 2) | (1 << (FB_SHIFT - 3)): \
|
---|
251 | FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
|
---|
252 | break; \
|
---|
253 | case sizeof (FbBits) - 3: \
|
---|
254 | FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \
|
---|
255 | case sizeof (FbBits) - 2: \
|
---|
256 | FbStorePart(dst,sizeof (FbBits) - 2,CARD16,xor); \
|
---|
257 | break; \
|
---|
258 | case sizeof (FbBits) - 1: \
|
---|
259 | FbStorePart(dst,sizeof (FbBits) - 1,CARD8,xor); \
|
---|
260 | break; \
|
---|
261 | default: \
|
---|
262 | WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, l)); \
|
---|
263 | break; \
|
---|
264 | } \
|
---|
265 | }
|
---|
266 |
|
---|
267 | #define FbDoRightMaskByteRRop(dst,rb,r,and,xor) { \
|
---|
268 | switch (rb) { \
|
---|
269 | case 1: \
|
---|
270 | FbStorePart(dst,0,CARD8,xor); \
|
---|
271 | break; \
|
---|
272 | case 2: \
|
---|
273 | FbStorePart(dst,0,CARD16,xor); \
|
---|
274 | break; \
|
---|
275 | case 3: \
|
---|
276 | FbStorePart(dst,0,CARD16,xor); \
|
---|
277 | FbStorePart(dst,2,CARD8,xor); \
|
---|
278 | break; \
|
---|
279 | default: \
|
---|
280 | WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, r)); \
|
---|
281 | } \
|
---|
282 | }
|
---|
283 |
|
---|
284 | #define FbMaskStip(x,w,l,n,r) { \
|
---|
285 | n = (w); \
|
---|
286 | r = FbRightStipMask((x)+n); \
|
---|
287 | l = FbLeftStipMask(x); \
|
---|
288 | if (l) { \
|
---|
289 | n -= FB_STIP_UNIT - ((x) & FB_STIP_MASK); \
|
---|
290 | if (n < 0) { \
|
---|
291 | n = 0; \
|
---|
292 | l &= r; \
|
---|
293 | r = 0; \
|
---|
294 | } \
|
---|
295 | } \
|
---|
296 | n >>= FB_STIP_SHIFT; \
|
---|
297 | }
|
---|
298 |
|
---|
299 | /*
|
---|
300 | * These macros are used to transparently stipple
|
---|
301 | * in copy mode; the expected usage is with 'n' constant
|
---|
302 | * so all of the conditional parts collapse into a minimal
|
---|
303 | * sequence of partial word writes
|
---|
304 | *
|
---|
305 | * 'n' is the bytemask of which bytes to store, 'a' is the address
|
---|
306 | * of the FbBits base unit, 'o' is the offset within that unit
|
---|
307 | *
|
---|
308 | * The term "lane" comes from the hardware term "byte-lane" which
|
---|
309 | */
|
---|
310 |
|
---|
311 | #define FbLaneCase1(n,a,o) \
|
---|
312 | if ((n) == 0x01) { \
|
---|
313 | WRITE((CARD8 *) ((a)+FbPatternOffset(o,CARD8)), fgxor); \
|
---|
314 | }
|
---|
315 |
|
---|
316 | #define FbLaneCase2(n,a,o) \
|
---|
317 | if ((n) == 0x03) { \
|
---|
318 | WRITE((CARD16 *) ((a)+FbPatternOffset(o,CARD16)), fgxor); \
|
---|
319 | } else { \
|
---|
320 | FbLaneCase1((n)&1,a,o) \
|
---|
321 | FbLaneCase1((n)>>1,a,(o)+1) \
|
---|
322 | }
|
---|
323 |
|
---|
324 | #define FbLaneCase4(n,a,o) \
|
---|
325 | if ((n) == 0x0f) { \
|
---|
326 | WRITE((CARD32 *) ((a)+FbPatternOffset(o,CARD32)), fgxor); \
|
---|
327 | } else { \
|
---|
328 | FbLaneCase2((n)&3,a,o) \
|
---|
329 | FbLaneCase2((n)>>2,a,(o)+2) \
|
---|
330 | }
|
---|
331 |
|
---|
332 | #define FbLaneCase(n,a) FbLaneCase4(n,(CARD8 *) (a),0)
|
---|
333 |
|
---|
334 | /* Rotate a filled pixel value to the specified alignement */
|
---|
335 | #define FbRot24(p,b) (FbScrRight(p,b) | FbScrLeft(p,24-(b)))
|
---|
336 | #define FbRot24Stip(p,b) (FbStipRight(p,b) | FbStipLeft(p,24-(b)))
|
---|
337 |
|
---|
338 | /* step a filled pixel value to the next/previous FB_UNIT alignment */
|
---|
339 | #define FbNext24Pix(p) (FbRot24(p,(24-FB_UNIT%24)))
|
---|
340 | #define FbPrev24Pix(p) (FbRot24(p,FB_UNIT%24))
|
---|
341 | #define FbNext24Stip(p) (FbRot24(p,(24-FB_STIP_UNIT%24)))
|
---|
342 | #define FbPrev24Stip(p) (FbRot24(p,FB_STIP_UNIT%24))
|
---|
343 |
|
---|
344 | /* step a rotation value to the next/previous rotation value */
|
---|
345 | #define FbNext24Rot(r) ((r) == 0 ? 16 : (r) - 8)
|
---|
346 | #define FbPrev24Rot(r) ((r) == 16 ? 0 : (r) + 8)
|
---|
347 |
|
---|
348 | #if IMAGE_BYTE_ORDER == MSBFirst
|
---|
349 | #define FbFirst24Rot(x) (((x) + 16) % 24)
|
---|
350 | #else
|
---|
351 | #define FbFirst24Rot(x) ((x) % 24)
|
---|
352 | #endif
|
---|
353 |
|
---|
354 | #define FbNext24RotStip(r) ((r) == 0 ? 16 : (r) - 8)
|
---|
355 | #define FbPrev24RotStip(r) ((r) == 16 ? 0 : (r) + 8)
|
---|
356 |
|
---|
357 | /* Whether 24-bit specific code is needed for this filled pixel value */
|
---|
358 | #define FbCheck24Pix(p) ((p) == FbNext24Pix(p))
|
---|
359 |
|
---|
360 | /* Macros for dealing with dashing */
|
---|
361 |
|
---|
362 | #define FbDashDeclare \
|
---|
363 | unsigned char *__dash, *__firstDash, *__lastDash
|
---|
364 |
|
---|
365 | #define FbDashInit(pGC,pPriv,dashOffset,dashlen,even) { \
|
---|
366 | (even) = TRUE; \
|
---|
367 | __firstDash = (pGC)->dash; \
|
---|
368 | __lastDash = __firstDash + (pGC)->numInDashList; \
|
---|
369 | (dashOffset) %= (pPriv)->dashLength; \
|
---|
370 | \
|
---|
371 | __dash = __firstDash; \
|
---|
372 | while ((dashOffset) >= ((dashlen) = *__dash)) \
|
---|
373 | { \
|
---|
374 | (dashOffset) -= (dashlen); \
|
---|
375 | (even) = 1-(even); \
|
---|
376 | if (++__dash == __lastDash) \
|
---|
377 | __dash = __firstDash; \
|
---|
378 | } \
|
---|
379 | (dashlen) -= (dashOffset); \
|
---|
380 | }
|
---|
381 |
|
---|
382 | #define FbDashNext(dashlen) { \
|
---|
383 | if (++__dash == __lastDash) \
|
---|
384 | __dash = __firstDash; \
|
---|
385 | (dashlen) = *__dash; \
|
---|
386 | }
|
---|
387 |
|
---|
388 | /* as numInDashList is always even, this case can skip a test */
|
---|
389 |
|
---|
390 | #define FbDashNextEven(dashlen) { \
|
---|
391 | (dashlen) = *++__dash; \
|
---|
392 | }
|
---|
393 |
|
---|
394 | #define FbDashNextOdd(dashlen) FbDashNext(dashlen)
|
---|
395 |
|
---|
396 | #define FbDashStep(dashlen,even) { \
|
---|
397 | if (!--(dashlen)) { \
|
---|
398 | FbDashNext(dashlen); \
|
---|
399 | (even) = 1-(even); \
|
---|
400 | } \
|
---|
401 | }
|
---|
402 |
|
---|
403 | extern _X_EXPORT const GCOps fbGCOps;
|
---|
404 | extern _X_EXPORT const GCFuncs fbGCFuncs;
|
---|
405 |
|
---|
406 | /* Framebuffer access wrapper */
|
---|
407 | typedef FbBits(*ReadMemoryProcPtr) (const void *src, int size);
|
---|
408 | typedef void (*WriteMemoryProcPtr) (void *dst, FbBits value, int size);
|
---|
409 | typedef void (*SetupWrapProcPtr) (ReadMemoryProcPtr * pRead,
|
---|
410 | WriteMemoryProcPtr * pWrite,
|
---|
411 | DrawablePtr pDraw);
|
---|
412 | typedef void (*FinishWrapProcPtr) (DrawablePtr pDraw);
|
---|
413 |
|
---|
414 | #ifdef FB_ACCESS_WRAPPER
|
---|
415 |
|
---|
416 | #define fbPrepareAccess(pDraw) \
|
---|
417 | fbGetScreenPrivate((pDraw)->pScreen)->setupWrap( \
|
---|
418 | &wfbReadMemory, \
|
---|
419 | &wfbWriteMemory, \
|
---|
420 | (pDraw))
|
---|
421 | #define fbFinishAccess(pDraw) \
|
---|
422 | fbGetScreenPrivate((pDraw)->pScreen)->finishWrap(pDraw)
|
---|
423 |
|
---|
424 | #else
|
---|
425 |
|
---|
426 | #define fbPrepareAccess(pPix)
|
---|
427 | #define fbFinishAccess(pDraw)
|
---|
428 |
|
---|
429 | #endif
|
---|
430 |
|
---|
431 | extern _X_EXPORT DevPrivateKey
|
---|
432 | fbGetScreenPrivateKey(void);
|
---|
433 |
|
---|
434 | /* private field of a screen */
|
---|
435 | typedef struct {
|
---|
436 | unsigned char win32bpp; /* window bpp for 32-bpp images */
|
---|
437 | unsigned char pix32bpp; /* pixmap bpp for 32-bpp images */
|
---|
438 | #ifdef FB_ACCESS_WRAPPER
|
---|
439 | SetupWrapProcPtr setupWrap; /* driver hook to set pixmap access wrapping */
|
---|
440 | FinishWrapProcPtr finishWrap; /* driver hook to clean up pixmap access wrapping */
|
---|
441 | #endif
|
---|
442 | DevPrivateKeyRec gcPrivateKeyRec;
|
---|
443 | DevPrivateKeyRec winPrivateKeyRec;
|
---|
444 | } FbScreenPrivRec, *FbScreenPrivPtr;
|
---|
445 |
|
---|
446 | #define fbGetScreenPrivate(pScreen) ((FbScreenPrivPtr) \
|
---|
447 | dixLookupPrivate(&(pScreen)->devPrivates, fbGetScreenPrivateKey()))
|
---|
448 |
|
---|
449 | /* private field of GC */
|
---|
450 | typedef struct {
|
---|
451 | FbBits and, xor; /* reduced rop values */
|
---|
452 | FbBits bgand, bgxor; /* for stipples */
|
---|
453 | FbBits fg, bg, pm; /* expanded and filled */
|
---|
454 | unsigned int dashLength; /* total of all dash elements */
|
---|
455 | unsigned char bpp; /* current drawable bpp */
|
---|
456 | } FbGCPrivRec, *FbGCPrivPtr;
|
---|
457 |
|
---|
458 | #define fbGetGCPrivateKey(pGC) (&fbGetScreenPrivate((pGC)->pScreen)->gcPrivateKeyRec)
|
---|
459 |
|
---|
460 | #define fbGetGCPrivate(pGC) ((FbGCPrivPtr)\
|
---|
461 | dixLookupPrivate(&(pGC)->devPrivates, fbGetGCPrivateKey(pGC)))
|
---|
462 |
|
---|
463 | #define fbGetCompositeClip(pGC) ((pGC)->pCompositeClip)
|
---|
464 | #define fbGetExpose(pGC) ((pGC)->fExpose)
|
---|
465 | #define fbGetFreeCompClip(pGC) ((pGC)->freeCompClip)
|
---|
466 | #define fbGetRotatedPixmap(pGC) ((pGC)->pRotatedPixmap)
|
---|
467 |
|
---|
468 | #define fbGetScreenPixmap(s) ((PixmapPtr) (s)->devPrivate)
|
---|
469 |
|
---|
470 | #define fbGetWinPrivateKey(pWin) (&fbGetScreenPrivate(((DrawablePtr) (pWin))->pScreen)->winPrivateKeyRec)
|
---|
471 |
|
---|
472 | #define fbGetWindowPixmap(pWin) ((PixmapPtr)\
|
---|
473 | dixLookupPrivate(&((WindowPtr)(pWin))->devPrivates, fbGetWinPrivateKey(pWin)))
|
---|
474 |
|
---|
475 | #ifdef ROOTLESS
|
---|
476 | #define __fbPixDrawableX(pPix) ((pPix)->drawable.x)
|
---|
477 | #define __fbPixDrawableY(pPix) ((pPix)->drawable.y)
|
---|
478 | #else
|
---|
479 | #define __fbPixDrawableX(pPix) 0
|
---|
480 | #define __fbPixDrawableY(pPix) 0
|
---|
481 | #endif
|
---|
482 |
|
---|
483 | #ifdef COMPOSITE
|
---|
484 | #define __fbPixOffXWin(pPix) (__fbPixDrawableX(pPix) - (pPix)->screen_x)
|
---|
485 | #define __fbPixOffYWin(pPix) (__fbPixDrawableY(pPix) - (pPix)->screen_y)
|
---|
486 | #else
|
---|
487 | #define __fbPixOffXWin(pPix) (__fbPixDrawableX(pPix))
|
---|
488 | #define __fbPixOffYWin(pPix) (__fbPixDrawableY(pPix))
|
---|
489 | #endif
|
---|
490 | #define __fbPixOffXPix(pPix) (__fbPixDrawableX(pPix))
|
---|
491 | #define __fbPixOffYPix(pPix) (__fbPixDrawableY(pPix))
|
---|
492 |
|
---|
493 | #define fbGetDrawablePixmap(pDrawable, pixmap, xoff, yoff) { \
|
---|
494 | if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
|
---|
495 | (pixmap) = fbGetWindowPixmap(pDrawable); \
|
---|
496 | (xoff) = __fbPixOffXWin(pixmap); \
|
---|
497 | (yoff) = __fbPixOffYWin(pixmap); \
|
---|
498 | } else { \
|
---|
499 | (pixmap) = (PixmapPtr) (pDrawable); \
|
---|
500 | (xoff) = __fbPixOffXPix(pixmap); \
|
---|
501 | (yoff) = __fbPixOffYPix(pixmap); \
|
---|
502 | } \
|
---|
503 | fbPrepareAccess(pDrawable); \
|
---|
504 | }
|
---|
505 |
|
---|
506 | #define fbGetPixmapBitsData(pixmap, pointer, stride, bpp) { \
|
---|
507 | (pointer) = (FbBits *) (pixmap)->devPrivate.ptr; \
|
---|
508 | (stride) = ((int) (pixmap)->devKind) / sizeof (FbBits); (void)(stride); \
|
---|
509 | (bpp) = (pixmap)->drawable.bitsPerPixel; (void)(bpp); \
|
---|
510 | }
|
---|
511 |
|
---|
512 | #define fbGetPixmapStipData(pixmap, pointer, stride, bpp) { \
|
---|
513 | (pointer) = (FbStip *) (pixmap)->devPrivate.ptr; \
|
---|
514 | (stride) = ((int) (pixmap)->devKind) / sizeof (FbStip); (void)(stride); \
|
---|
515 | (bpp) = (pixmap)->drawable.bitsPerPixel; (void)(bpp); \
|
---|
516 | }
|
---|
517 |
|
---|
518 | #define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
|
---|
519 | PixmapPtr _pPix; \
|
---|
520 | fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff); \
|
---|
521 | fbGetPixmapBitsData(_pPix, pointer, stride, bpp); \
|
---|
522 | }
|
---|
523 |
|
---|
524 | #define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
|
---|
525 | PixmapPtr _pPix; \
|
---|
526 | fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff); \
|
---|
527 | fbGetPixmapStipData(_pPix, pointer, stride, bpp); \
|
---|
528 | }
|
---|
529 |
|
---|
530 | /*
|
---|
531 | * XFree86 empties the root BorderClip when the VT is inactive,
|
---|
532 | * here's a macro which uses that to disable GetImage and GetSpans
|
---|
533 | */
|
---|
534 |
|
---|
535 | #define fbWindowEnabled(pWin) \
|
---|
536 | RegionNotEmpty(&(pWin)->drawable.pScreen->root->borderClip)
|
---|
537 |
|
---|
538 | #define fbDrawableEnabled(pDrawable) \
|
---|
539 | ((pDrawable)->type == DRAWABLE_PIXMAP ? \
|
---|
540 | TRUE : fbWindowEnabled((WindowPtr) pDrawable))
|
---|
541 |
|
---|
542 | #define FbPowerOfTwo(w) (((w) & ((w) - 1)) == 0)
|
---|
543 | /*
|
---|
544 | * Accelerated tiles are power of 2 width <= FB_UNIT
|
---|
545 | */
|
---|
546 | #define FbEvenTile(w) ((w) <= FB_UNIT && FbPowerOfTwo(w))
|
---|
547 |
|
---|
548 | /*
|
---|
549 | * fb24_32.c
|
---|
550 | */
|
---|
551 | extern _X_EXPORT void
|
---|
552 |
|
---|
553 | fb24_32GetSpans(DrawablePtr pDrawable,
|
---|
554 | int wMax,
|
---|
555 | DDXPointPtr ppt, int *pwidth, int nspans, char *pchardstStart);
|
---|
556 |
|
---|
557 | extern _X_EXPORT void
|
---|
558 |
|
---|
559 | fb24_32SetSpans(DrawablePtr pDrawable,
|
---|
560 | GCPtr pGC,
|
---|
561 | char *src,
|
---|
562 | DDXPointPtr ppt, int *pwidth, int nspans, int fSorted);
|
---|
563 |
|
---|
564 | extern _X_EXPORT void
|
---|
565 |
|
---|
566 | fb24_32PutZImage(DrawablePtr pDrawable,
|
---|
567 | RegionPtr pClip,
|
---|
568 | int alu,
|
---|
569 | FbBits pm,
|
---|
570 | int x,
|
---|
571 | int y, int width, int height, CARD8 *src, FbStride srcStride);
|
---|
572 |
|
---|
573 | extern _X_EXPORT void
|
---|
574 |
|
---|
575 | fb24_32GetImage(DrawablePtr pDrawable,
|
---|
576 | int x,
|
---|
577 | int y,
|
---|
578 | int w,
|
---|
579 | int h, unsigned int format, unsigned long planeMask, char *d);
|
---|
580 |
|
---|
581 | extern _X_EXPORT void
|
---|
582 |
|
---|
583 | fb24_32CopyMtoN(DrawablePtr pSrcDrawable,
|
---|
584 | DrawablePtr pDstDrawable,
|
---|
585 | GCPtr pGC,
|
---|
586 | BoxPtr pbox,
|
---|
587 | int nbox,
|
---|
588 | int dx,
|
---|
589 | int dy,
|
---|
590 | Bool reverse, Bool upsidedown, Pixel bitplane, void *closure);
|
---|
591 |
|
---|
592 | extern _X_EXPORT PixmapPtr
|
---|
593 | fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel);
|
---|
594 |
|
---|
595 | extern _X_EXPORT Bool
|
---|
596 | fb24_32CreateScreenResources(ScreenPtr pScreen);
|
---|
597 |
|
---|
598 | extern _X_EXPORT Bool
|
---|
599 |
|
---|
600 | fb24_32ModifyPixmapHeader(PixmapPtr pPixmap,
|
---|
601 | int width,
|
---|
602 | int height,
|
---|
603 | int depth,
|
---|
604 | int bitsPerPixel, int devKind, void *pPixData);
|
---|
605 |
|
---|
606 | /*
|
---|
607 | * fballpriv.c
|
---|
608 | */
|
---|
609 | extern _X_EXPORT Bool
|
---|
610 | fbAllocatePrivates(ScreenPtr pScreen);
|
---|
611 |
|
---|
612 | /*
|
---|
613 | * fbarc.c
|
---|
614 | */
|
---|
615 |
|
---|
616 | extern _X_EXPORT void
|
---|
617 | fbPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * parcs);
|
---|
618 |
|
---|
619 | /*
|
---|
620 | * fbbits.c
|
---|
621 | */
|
---|
622 |
|
---|
623 | extern _X_EXPORT void
|
---|
624 |
|
---|
625 | fbBresSolid8(DrawablePtr pDrawable,
|
---|
626 | GCPtr pGC,
|
---|
627 | int dashOffset,
|
---|
628 | int signdx,
|
---|
629 | int signdy,
|
---|
630 | int axis, int x, int y, int e, int e1, int e3, int len);
|
---|
631 |
|
---|
632 | extern _X_EXPORT void
|
---|
633 |
|
---|
634 | fbBresDash8(DrawablePtr pDrawable,
|
---|
635 | GCPtr pGC,
|
---|
636 | int dashOffset,
|
---|
637 | int signdx,
|
---|
638 | int signdy, int axis, int x, int y, int e, int e1, int e3, int len);
|
---|
639 |
|
---|
640 | extern _X_EXPORT void
|
---|
641 |
|
---|
642 | fbDots8(FbBits * dst,
|
---|
643 | FbStride dstStride,
|
---|
644 | int dstBpp,
|
---|
645 | BoxPtr pBox,
|
---|
646 | xPoint * pts,
|
---|
647 | int npt,
|
---|
648 | int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor);
|
---|
649 |
|
---|
650 | extern _X_EXPORT void
|
---|
651 |
|
---|
652 | fbArc8(FbBits * dst,
|
---|
653 | FbStride dstStride,
|
---|
654 | int dstBpp, xArc * arc, int dx, int dy, FbBits and, FbBits xor);
|
---|
655 |
|
---|
656 | extern _X_EXPORT void
|
---|
657 |
|
---|
658 | fbGlyph8(FbBits * dstLine,
|
---|
659 | FbStride dstStride,
|
---|
660 | int dstBpp, FbStip * stipple, FbBits fg, int height, int shift);
|
---|
661 |
|
---|
662 | extern _X_EXPORT void
|
---|
663 |
|
---|
664 | fbPolyline8(DrawablePtr pDrawable,
|
---|
665 | GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig);
|
---|
666 |
|
---|
667 | extern _X_EXPORT void
|
---|
668 | fbPolySegment8(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
|
---|
669 |
|
---|
670 | extern _X_EXPORT void
|
---|
671 |
|
---|
672 | fbBresSolid16(DrawablePtr pDrawable,
|
---|
673 | GCPtr pGC,
|
---|
674 | int dashOffset,
|
---|
675 | int signdx,
|
---|
676 | int signdy,
|
---|
677 | int axis, int x, int y, int e, int e1, int e3, int len);
|
---|
678 |
|
---|
679 | extern _X_EXPORT void
|
---|
680 |
|
---|
681 | fbBresDash16(DrawablePtr pDrawable,
|
---|
682 | GCPtr pGC,
|
---|
683 | int dashOffset,
|
---|
684 | int signdx,
|
---|
685 | int signdy,
|
---|
686 | int axis, int x, int y, int e, int e1, int e3, int len);
|
---|
687 |
|
---|
688 | extern _X_EXPORT void
|
---|
689 |
|
---|
690 | fbDots16(FbBits * dst,
|
---|
691 | FbStride dstStride,
|
---|
692 | int dstBpp,
|
---|
693 | BoxPtr pBox,
|
---|
694 | xPoint * pts,
|
---|
695 | int npt,
|
---|
696 | int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor);
|
---|
697 |
|
---|
698 | extern _X_EXPORT void
|
---|
699 |
|
---|
700 | fbArc16(FbBits * dst,
|
---|
701 | FbStride dstStride,
|
---|
702 | int dstBpp, xArc * arc, int dx, int dy, FbBits and, FbBits xor);
|
---|
703 |
|
---|
704 | extern _X_EXPORT void
|
---|
705 |
|
---|
706 | fbGlyph16(FbBits * dstLine,
|
---|
707 | FbStride dstStride,
|
---|
708 | int dstBpp, FbStip * stipple, FbBits fg, int height, int shift);
|
---|
709 |
|
---|
710 | extern _X_EXPORT void
|
---|
711 |
|
---|
712 | fbPolyline16(DrawablePtr pDrawable,
|
---|
713 | GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig);
|
---|
714 |
|
---|
715 | extern _X_EXPORT void
|
---|
716 | fbPolySegment16(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
|
---|
717 |
|
---|
718 | extern _X_EXPORT void
|
---|
719 |
|
---|
720 | fbBresSolid24(DrawablePtr pDrawable,
|
---|
721 | GCPtr pGC,
|
---|
722 | int dashOffset,
|
---|
723 | int signdx,
|
---|
724 | int signdy,
|
---|
725 | int axis, int x, int y, int e, int e1, int e3, int len);
|
---|
726 |
|
---|
727 | extern _X_EXPORT void
|
---|
728 |
|
---|
729 | fbBresDash24(DrawablePtr pDrawable,
|
---|
730 | GCPtr pGC,
|
---|
731 | int dashOffset,
|
---|
732 | int signdx,
|
---|
733 | int signdy,
|
---|
734 | int axis, int x, int y, int e, int e1, int e3, int len);
|
---|
735 |
|
---|
736 | extern _X_EXPORT void
|
---|
737 |
|
---|
738 | fbDots24(FbBits * dst,
|
---|
739 | FbStride dstStride,
|
---|
740 | int dstBpp,
|
---|
741 | BoxPtr pBox,
|
---|
742 | xPoint * pts,
|
---|
743 | int npt,
|
---|
744 | int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor);
|
---|
745 |
|
---|
746 | extern _X_EXPORT void
|
---|
747 |
|
---|
748 | fbArc24(FbBits * dst,
|
---|
749 | FbStride dstStride,
|
---|
750 | int dstBpp, xArc * arc, int dx, int dy, FbBits and, FbBits xor);
|
---|
751 |
|
---|
752 | extern _X_EXPORT void
|
---|
753 | fbPolyline24(DrawablePtr pDrawable,
|
---|
754 | GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig);
|
---|
755 |
|
---|
756 | extern _X_EXPORT void
|
---|
757 | fbPolySegment24(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
|
---|
758 |
|
---|
759 | extern _X_EXPORT void
|
---|
760 |
|
---|
761 | fbBresSolid32(DrawablePtr pDrawable,
|
---|
762 | GCPtr pGC,
|
---|
763 | int dashOffset,
|
---|
764 | int signdx,
|
---|
765 | int signdy,
|
---|
766 | int axis, int x, int y, int e, int e1, int e3, int len);
|
---|
767 |
|
---|
768 | extern _X_EXPORT void
|
---|
769 |
|
---|
770 | fbBresDash32(DrawablePtr pDrawable,
|
---|
771 | GCPtr pGC,
|
---|
772 | int dashOffset,
|
---|
773 | int signdx,
|
---|
774 | int signdy,
|
---|
775 | int axis, int x, int y, int e, int e1, int e3, int len);
|
---|
776 |
|
---|
777 | extern _X_EXPORT void
|
---|
778 |
|
---|
779 | fbDots32(FbBits * dst,
|
---|
780 | FbStride dstStride,
|
---|
781 | int dstBpp,
|
---|
782 | BoxPtr pBox,
|
---|
783 | xPoint * pts,
|
---|
784 | int npt,
|
---|
785 | int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor);
|
---|
786 |
|
---|
787 | extern _X_EXPORT void
|
---|
788 |
|
---|
789 | fbArc32(FbBits * dst,
|
---|
790 | FbStride dstStride,
|
---|
791 | int dstBpp, xArc * arc, int dx, int dy, FbBits and, FbBits xor);
|
---|
792 |
|
---|
793 | extern _X_EXPORT void
|
---|
794 |
|
---|
795 | fbGlyph32(FbBits * dstLine,
|
---|
796 | FbStride dstStride,
|
---|
797 | int dstBpp, FbStip * stipple, FbBits fg, int height, int shift);
|
---|
798 | extern _X_EXPORT void
|
---|
799 |
|
---|
800 | fbPolyline32(DrawablePtr pDrawable,
|
---|
801 | GCPtr pGC, int mode, int npt, DDXPointPtr ptsOrig);
|
---|
802 |
|
---|
803 | extern _X_EXPORT void
|
---|
804 | fbPolySegment32(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
|
---|
805 |
|
---|
806 | /*
|
---|
807 | * fbblt.c
|
---|
808 | */
|
---|
809 | extern _X_EXPORT void
|
---|
810 |
|
---|
811 | fbBlt(FbBits * src,
|
---|
812 | FbStride srcStride,
|
---|
813 | int srcX,
|
---|
814 | FbBits * dst,
|
---|
815 | FbStride dstStride,
|
---|
816 | int dstX,
|
---|
817 | int width,
|
---|
818 | int height, int alu, FbBits pm, int bpp, Bool reverse, Bool upsidedown);
|
---|
819 |
|
---|
820 | extern _X_EXPORT void
|
---|
821 |
|
---|
822 | fbBlt24(FbBits * srcLine,
|
---|
823 | FbStride srcStride,
|
---|
824 | int srcX,
|
---|
825 | FbBits * dstLine,
|
---|
826 | FbStride dstStride,
|
---|
827 | int dstX,
|
---|
828 | int width,
|
---|
829 | int height, int alu, FbBits pm, Bool reverse, Bool upsidedown);
|
---|
830 |
|
---|
831 | extern _X_EXPORT void
|
---|
832 | fbBltStip(FbStip * src, FbStride srcStride, /* in FbStip units, not FbBits units */
|
---|
833 | int srcX, FbStip * dst, FbStride dstStride, /* in FbStip units, not FbBits units */
|
---|
834 | int dstX, int width, int height, int alu, FbBits pm, int bpp);
|
---|
835 |
|
---|
836 | /*
|
---|
837 | * fbbltone.c
|
---|
838 | */
|
---|
839 | extern _X_EXPORT void
|
---|
840 |
|
---|
841 | fbBltOne(FbStip * src,
|
---|
842 | FbStride srcStride,
|
---|
843 | int srcX,
|
---|
844 | FbBits * dst,
|
---|
845 | FbStride dstStride,
|
---|
846 | int dstX,
|
---|
847 | int dstBpp,
|
---|
848 | int width,
|
---|
849 | int height, FbBits fgand, FbBits fbxor, FbBits bgand, FbBits bgxor);
|
---|
850 |
|
---|
851 | extern _X_EXPORT void
|
---|
852 | fbBltOne24(FbStip * src, FbStride srcStride, /* FbStip units per scanline */
|
---|
853 | int srcX, /* bit position of source */
|
---|
854 | FbBits * dst, FbStride dstStride, /* FbBits units per scanline */
|
---|
855 | int dstX, /* bit position of dest */
|
---|
856 | int dstBpp, /* bits per destination unit */
|
---|
857 | int width, /* width in bits of destination */
|
---|
858 | int height, /* height in scanlines */
|
---|
859 | FbBits fgand, /* rrop values */
|
---|
860 | FbBits fgxor, FbBits bgand, FbBits bgxor);
|
---|
861 |
|
---|
862 | extern _X_EXPORT void
|
---|
863 |
|
---|
864 | fbBltPlane(FbBits * src,
|
---|
865 | FbStride srcStride,
|
---|
866 | int srcX,
|
---|
867 | int srcBpp,
|
---|
868 | FbStip * dst,
|
---|
869 | FbStride dstStride,
|
---|
870 | int dstX,
|
---|
871 | int width,
|
---|
872 | int height,
|
---|
873 | FbStip fgand,
|
---|
874 | FbStip fgxor, FbStip bgand, FbStip bgxor, Pixel planeMask);
|
---|
875 |
|
---|
876 | /*
|
---|
877 | * fbcmap_mi.c
|
---|
878 | */
|
---|
879 | extern _X_EXPORT int
|
---|
880 | fbListInstalledColormaps(ScreenPtr pScreen, Colormap * pmaps);
|
---|
881 |
|
---|
882 | extern _X_EXPORT void
|
---|
883 | fbInstallColormap(ColormapPtr pmap);
|
---|
884 |
|
---|
885 | extern _X_EXPORT void
|
---|
886 | fbUninstallColormap(ColormapPtr pmap);
|
---|
887 |
|
---|
888 | extern _X_EXPORT void
|
---|
889 |
|
---|
890 | fbResolveColor(unsigned short *pred,
|
---|
891 | unsigned short *pgreen,
|
---|
892 | unsigned short *pblue, VisualPtr pVisual);
|
---|
893 |
|
---|
894 | extern _X_EXPORT Bool
|
---|
895 | fbInitializeColormap(ColormapPtr pmap);
|
---|
896 |
|
---|
897 | extern _X_EXPORT int
|
---|
898 |
|
---|
899 | fbExpandDirectColors(ColormapPtr pmap,
|
---|
900 | int ndef, xColorItem * indefs, xColorItem * outdefs);
|
---|
901 |
|
---|
902 | extern _X_EXPORT Bool
|
---|
903 | fbCreateDefColormap(ScreenPtr pScreen);
|
---|
904 |
|
---|
905 | extern _X_EXPORT void
|
---|
906 | fbClearVisualTypes(void);
|
---|
907 |
|
---|
908 | extern _X_EXPORT Bool
|
---|
909 | fbHasVisualTypes(int depth);
|
---|
910 |
|
---|
911 | extern _X_EXPORT Bool
|
---|
912 | fbSetVisualTypes(int depth, int visuals, int bitsPerRGB);
|
---|
913 |
|
---|
914 | extern _X_EXPORT Bool
|
---|
915 |
|
---|
916 | fbSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB,
|
---|
917 | Pixel redMask, Pixel greenMask, Pixel blueMask);
|
---|
918 |
|
---|
919 | extern _X_EXPORT Bool
|
---|
920 |
|
---|
921 | fbInitVisuals(VisualPtr * visualp,
|
---|
922 | DepthPtr * depthp,
|
---|
923 | int *nvisualp,
|
---|
924 | int *ndepthp,
|
---|
925 | int *rootDepthp,
|
---|
926 | VisualID * defaultVisp, unsigned long sizes, int bitsPerRGB);
|
---|
927 |
|
---|
928 | /*
|
---|
929 | * fbcopy.c
|
---|
930 | */
|
---|
931 |
|
---|
932 | extern _X_EXPORT void
|
---|
933 |
|
---|
934 | fbCopyNtoN(DrawablePtr pSrcDrawable,
|
---|
935 | DrawablePtr pDstDrawable,
|
---|
936 | GCPtr pGC,
|
---|
937 | BoxPtr pbox,
|
---|
938 | int nbox,
|
---|
939 | int dx,
|
---|
940 | int dy,
|
---|
941 | Bool reverse, Bool upsidedown, Pixel bitplane, void *closure);
|
---|
942 |
|
---|
943 | extern _X_EXPORT void
|
---|
944 |
|
---|
945 | fbCopy1toN(DrawablePtr pSrcDrawable,
|
---|
946 | DrawablePtr pDstDrawable,
|
---|
947 | GCPtr pGC,
|
---|
948 | BoxPtr pbox,
|
---|
949 | int nbox,
|
---|
950 | int dx,
|
---|
951 | int dy,
|
---|
952 | Bool reverse, Bool upsidedown, Pixel bitplane, void *closure);
|
---|
953 |
|
---|
954 | extern _X_EXPORT void
|
---|
955 |
|
---|
956 | fbCopyNto1(DrawablePtr pSrcDrawable,
|
---|
957 | DrawablePtr pDstDrawable,
|
---|
958 | GCPtr pGC,
|
---|
959 | BoxPtr pbox,
|
---|
960 | int nbox,
|
---|
961 | int dx,
|
---|
962 | int dy,
|
---|
963 | Bool reverse, Bool upsidedown, Pixel bitplane, void *closure);
|
---|
964 |
|
---|
965 | extern _X_EXPORT RegionPtr
|
---|
966 |
|
---|
967 | fbCopyArea(DrawablePtr pSrcDrawable,
|
---|
968 | DrawablePtr pDstDrawable,
|
---|
969 | GCPtr pGC,
|
---|
970 | int xIn, int yIn, int widthSrc, int heightSrc, int xOut, int yOut);
|
---|
971 |
|
---|
972 | extern _X_EXPORT RegionPtr
|
---|
973 |
|
---|
974 | fbCopyPlane(DrawablePtr pSrcDrawable,
|
---|
975 | DrawablePtr pDstDrawable,
|
---|
976 | GCPtr pGC,
|
---|
977 | int xIn,
|
---|
978 | int yIn,
|
---|
979 | int widthSrc,
|
---|
980 | int heightSrc, int xOut, int yOut, unsigned long bitplane);
|
---|
981 |
|
---|
982 | /*
|
---|
983 | * fbfill.c
|
---|
984 | */
|
---|
985 | extern _X_EXPORT void
|
---|
986 | fbFill(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int width, int height);
|
---|
987 |
|
---|
988 | extern _X_EXPORT void
|
---|
989 |
|
---|
990 | fbSolidBoxClipped(DrawablePtr pDrawable,
|
---|
991 | RegionPtr pClip,
|
---|
992 | int xa, int ya, int xb, int yb, FbBits and, FbBits xor);
|
---|
993 |
|
---|
994 | /*
|
---|
995 | * fbfillrect.c
|
---|
996 | */
|
---|
997 | extern _X_EXPORT void
|
---|
998 |
|
---|
999 | fbPolyFillRect(DrawablePtr pDrawable,
|
---|
1000 | GCPtr pGC, int nrectInit, xRectangle *prectInit);
|
---|
1001 |
|
---|
1002 | #define fbPolyFillArc miPolyFillArc
|
---|
1003 |
|
---|
1004 | #define fbFillPolygon miFillPolygon
|
---|
1005 |
|
---|
1006 | /*
|
---|
1007 | * fbfillsp.c
|
---|
1008 | */
|
---|
1009 | extern _X_EXPORT void
|
---|
1010 |
|
---|
1011 | fbFillSpans(DrawablePtr pDrawable,
|
---|
1012 | GCPtr pGC,
|
---|
1013 | int nInit, DDXPointPtr pptInit, int *pwidthInit, int fSorted);
|
---|
1014 |
|
---|
1015 | /*
|
---|
1016 | * fbgc.c
|
---|
1017 | */
|
---|
1018 |
|
---|
1019 | extern _X_EXPORT Bool
|
---|
1020 | fbCreateGC(GCPtr pGC);
|
---|
1021 |
|
---|
1022 | extern _X_EXPORT void
|
---|
1023 | fbPadPixmap(PixmapPtr pPixmap);
|
---|
1024 |
|
---|
1025 | extern _X_EXPORT void
|
---|
1026 | fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable);
|
---|
1027 |
|
---|
1028 | /*
|
---|
1029 | * fbgetsp.c
|
---|
1030 | */
|
---|
1031 | extern _X_EXPORT void
|
---|
1032 |
|
---|
1033 | fbGetSpans(DrawablePtr pDrawable,
|
---|
1034 | int wMax,
|
---|
1035 | DDXPointPtr ppt, int *pwidth, int nspans, char *pchardstStart);
|
---|
1036 |
|
---|
1037 | /*
|
---|
1038 | * fbglyph.c
|
---|
1039 | */
|
---|
1040 |
|
---|
1041 | extern _X_EXPORT void
|
---|
1042 |
|
---|
1043 | fbPolyGlyphBlt(DrawablePtr pDrawable,
|
---|
1044 | GCPtr pGC,
|
---|
1045 | int x,
|
---|
1046 | int y,
|
---|
1047 | unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase);
|
---|
1048 |
|
---|
1049 | extern _X_EXPORT void
|
---|
1050 |
|
---|
1051 | fbImageGlyphBlt(DrawablePtr pDrawable,
|
---|
1052 | GCPtr pGC,
|
---|
1053 | int x,
|
---|
1054 | int y,
|
---|
1055 | unsigned int nglyph, CharInfoPtr * ppci, void *pglyphBase);
|
---|
1056 |
|
---|
1057 | /*
|
---|
1058 | * fbimage.c
|
---|
1059 | */
|
---|
1060 |
|
---|
1061 | extern _X_EXPORT void
|
---|
1062 |
|
---|
1063 | fbPutImage(DrawablePtr pDrawable,
|
---|
1064 | GCPtr pGC,
|
---|
1065 | int depth,
|
---|
1066 | int x, int y, int w, int h, int leftPad, int format, char *pImage);
|
---|
1067 |
|
---|
1068 | extern _X_EXPORT void
|
---|
1069 |
|
---|
1070 | fbPutZImage(DrawablePtr pDrawable,
|
---|
1071 | RegionPtr pClip,
|
---|
1072 | int alu,
|
---|
1073 | FbBits pm,
|
---|
1074 | int x,
|
---|
1075 | int y, int width, int height, FbStip * src, FbStride srcStride);
|
---|
1076 |
|
---|
1077 | extern _X_EXPORT void
|
---|
1078 |
|
---|
1079 | fbPutXYImage(DrawablePtr pDrawable,
|
---|
1080 | RegionPtr pClip,
|
---|
1081 | FbBits fg,
|
---|
1082 | FbBits bg,
|
---|
1083 | FbBits pm,
|
---|
1084 | int alu,
|
---|
1085 | Bool opaque,
|
---|
1086 | int x,
|
---|
1087 | int y,
|
---|
1088 | int width, int height, FbStip * src, FbStride srcStride, int srcX);
|
---|
1089 |
|
---|
1090 | extern _X_EXPORT void
|
---|
1091 |
|
---|
1092 | fbGetImage(DrawablePtr pDrawable,
|
---|
1093 | int x,
|
---|
1094 | int y,
|
---|
1095 | int w, int h, unsigned int format, unsigned long planeMask, char *d);
|
---|
1096 | /*
|
---|
1097 | * fbline.c
|
---|
1098 | */
|
---|
1099 |
|
---|
1100 | extern _X_EXPORT void
|
---|
1101 | fbPolyLine(DrawablePtr pDrawable,
|
---|
1102 | GCPtr pGC, int mode, int npt, DDXPointPtr ppt);
|
---|
1103 |
|
---|
1104 | extern _X_EXPORT void
|
---|
1105 | fbFixCoordModePrevious(int npt, DDXPointPtr ppt);
|
---|
1106 |
|
---|
1107 | extern _X_EXPORT void
|
---|
1108 | fbPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pseg);
|
---|
1109 |
|
---|
1110 | #define fbPolyRectangle miPolyRectangle
|
---|
1111 |
|
---|
1112 | /*
|
---|
1113 | * fbpict.c
|
---|
1114 | */
|
---|
1115 |
|
---|
1116 | extern _X_EXPORT Bool
|
---|
1117 | fbPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats);
|
---|
1118 |
|
---|
1119 | extern _X_EXPORT void
|
---|
1120 | fbDestroyGlyphCache(void);
|
---|
1121 |
|
---|
1122 | /*
|
---|
1123 | * fbpixmap.c
|
---|
1124 | */
|
---|
1125 |
|
---|
1126 | extern _X_EXPORT PixmapPtr
|
---|
1127 |
|
---|
1128 | fbCreatePixmapBpp(ScreenPtr pScreen, int width, int height, int depth, int bpp,
|
---|
1129 | unsigned usage_hint);
|
---|
1130 |
|
---|
1131 | extern _X_EXPORT PixmapPtr
|
---|
1132 |
|
---|
1133 | fbCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
---|
1134 | unsigned usage_hint);
|
---|
1135 |
|
---|
1136 | extern _X_EXPORT Bool
|
---|
1137 | fbDestroyPixmap(PixmapPtr pPixmap);
|
---|
1138 |
|
---|
1139 | extern _X_EXPORT RegionPtr
|
---|
1140 | fbPixmapToRegion(PixmapPtr pPix);
|
---|
1141 |
|
---|
1142 | /*
|
---|
1143 | * fbpoint.c
|
---|
1144 | */
|
---|
1145 |
|
---|
1146 | extern _X_EXPORT void
|
---|
1147 |
|
---|
1148 | fbPolyPoint(DrawablePtr pDrawable,
|
---|
1149 | GCPtr pGC, int mode, int npt, xPoint * pptInit);
|
---|
1150 |
|
---|
1151 | /*
|
---|
1152 | * fbpush.c
|
---|
1153 | */
|
---|
1154 |
|
---|
1155 | extern _X_EXPORT void
|
---|
1156 |
|
---|
1157 | fbPushImage(DrawablePtr pDrawable,
|
---|
1158 | GCPtr pGC,
|
---|
1159 | FbStip * src,
|
---|
1160 | FbStride srcStride, int srcX, int x, int y, int width, int height);
|
---|
1161 |
|
---|
1162 | extern _X_EXPORT void
|
---|
1163 |
|
---|
1164 | fbPushPixels(GCPtr pGC,
|
---|
1165 | PixmapPtr pBitmap,
|
---|
1166 | DrawablePtr pDrawable, int dx, int dy, int xOrg, int yOrg);
|
---|
1167 |
|
---|
1168 | /*
|
---|
1169 | * fbscreen.c
|
---|
1170 | */
|
---|
1171 |
|
---|
1172 | extern _X_EXPORT Bool
|
---|
1173 | fbCloseScreen(ScreenPtr pScreen);
|
---|
1174 |
|
---|
1175 | extern _X_EXPORT Bool
|
---|
1176 | fbRealizeFont(ScreenPtr pScreen, FontPtr pFont);
|
---|
1177 |
|
---|
1178 | extern _X_EXPORT Bool
|
---|
1179 | fbUnrealizeFont(ScreenPtr pScreen, FontPtr pFont);
|
---|
1180 |
|
---|
1181 | extern _X_EXPORT void
|
---|
1182 |
|
---|
1183 | fbQueryBestSize(int class,
|
---|
1184 | unsigned short *width, unsigned short *height,
|
---|
1185 | ScreenPtr pScreen);
|
---|
1186 |
|
---|
1187 | extern _X_EXPORT PixmapPtr
|
---|
1188 | _fbGetWindowPixmap(WindowPtr pWindow);
|
---|
1189 |
|
---|
1190 | extern _X_EXPORT void
|
---|
1191 | _fbSetWindowPixmap(WindowPtr pWindow, PixmapPtr pPixmap);
|
---|
1192 |
|
---|
1193 | extern _X_EXPORT Bool
|
---|
1194 | fbSetupScreen(ScreenPtr pScreen, void *pbits, /* pointer to screen bitmap */
|
---|
1195 | int xsize, /* in pixels */
|
---|
1196 | int ysize, int dpix, /* dots per inch */
|
---|
1197 | int dpiy, int width, /* pixel width of frame buffer */
|
---|
1198 | int bpp); /* bits per pixel of frame buffer */
|
---|
1199 |
|
---|
1200 | extern _X_EXPORT Bool
|
---|
1201 |
|
---|
1202 | wfbFinishScreenInit(ScreenPtr pScreen,
|
---|
1203 | void *pbits,
|
---|
1204 | int xsize,
|
---|
1205 | int ysize,
|
---|
1206 | int dpix,
|
---|
1207 | int dpiy,
|
---|
1208 | int width,
|
---|
1209 | int bpp,
|
---|
1210 | SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap);
|
---|
1211 |
|
---|
1212 | extern _X_EXPORT Bool
|
---|
1213 |
|
---|
1214 | wfbScreenInit(ScreenPtr pScreen,
|
---|
1215 | void *pbits,
|
---|
1216 | int xsize,
|
---|
1217 | int ysize,
|
---|
1218 | int dpix,
|
---|
1219 | int dpiy,
|
---|
1220 | int width,
|
---|
1221 | int bpp,
|
---|
1222 | SetupWrapProcPtr setupWrap, FinishWrapProcPtr finishWrap);
|
---|
1223 |
|
---|
1224 | extern _X_EXPORT Bool
|
---|
1225 |
|
---|
1226 | fbFinishScreenInit(ScreenPtr pScreen,
|
---|
1227 | void *pbits,
|
---|
1228 | int xsize,
|
---|
1229 | int ysize, int dpix, int dpiy, int width, int bpp);
|
---|
1230 |
|
---|
1231 | extern _X_EXPORT Bool
|
---|
1232 |
|
---|
1233 | fbScreenInit(ScreenPtr pScreen,
|
---|
1234 | void *pbits,
|
---|
1235 | int xsize, int ysize, int dpix, int dpiy, int width, int bpp);
|
---|
1236 |
|
---|
1237 | /*
|
---|
1238 | * fbseg.c
|
---|
1239 | */
|
---|
1240 | typedef void FbBres(DrawablePtr pDrawable,
|
---|
1241 | GCPtr pGC,
|
---|
1242 | int dashOffset,
|
---|
1243 | int signdx,
|
---|
1244 | int signdy,
|
---|
1245 | int axis, int x, int y, int e, int e1, int e3, int len);
|
---|
1246 |
|
---|
1247 | extern _X_EXPORT void
|
---|
1248 | fbSegment(DrawablePtr pDrawable,
|
---|
1249 | GCPtr pGC,
|
---|
1250 | int xa, int ya, int xb, int yb, Bool drawLast, int *dashOffset);
|
---|
1251 |
|
---|
1252 | /*
|
---|
1253 | * fbsetsp.c
|
---|
1254 | */
|
---|
1255 |
|
---|
1256 | extern _X_EXPORT void
|
---|
1257 | fbSetSpans(DrawablePtr pDrawable,
|
---|
1258 | GCPtr pGC,
|
---|
1259 | char *src, DDXPointPtr ppt, int *pwidth, int nspans, int fSorted);
|
---|
1260 |
|
---|
1261 | /*
|
---|
1262 | * fbsolid.c
|
---|
1263 | */
|
---|
1264 |
|
---|
1265 | extern _X_EXPORT void
|
---|
1266 |
|
---|
1267 | fbSolid(FbBits * dst,
|
---|
1268 | FbStride dstStride,
|
---|
1269 | int dstX, int bpp, int width, int height, FbBits and, FbBits xor);
|
---|
1270 |
|
---|
1271 | extern _X_EXPORT void
|
---|
1272 |
|
---|
1273 | fbSolid24(FbBits * dst,
|
---|
1274 | FbStride dstStride,
|
---|
1275 | int dstX, int width, int height, FbBits and, FbBits xor);
|
---|
1276 |
|
---|
1277 | /*
|
---|
1278 | * fbutil.c
|
---|
1279 | */
|
---|
1280 | extern _X_EXPORT FbBits fbReplicatePixel(Pixel p, int bpp);
|
---|
1281 |
|
---|
1282 | #ifdef FB_ACCESS_WRAPPER
|
---|
1283 | extern _X_EXPORT ReadMemoryProcPtr wfbReadMemory;
|
---|
1284 | extern _X_EXPORT WriteMemoryProcPtr wfbWriteMemory;
|
---|
1285 | #endif
|
---|
1286 |
|
---|
1287 | /*
|
---|
1288 | * fbwindow.c
|
---|
1289 | */
|
---|
1290 |
|
---|
1291 | extern _X_EXPORT Bool
|
---|
1292 | fbCreateWindow(WindowPtr pWin);
|
---|
1293 |
|
---|
1294 | extern _X_EXPORT Bool
|
---|
1295 | fbDestroyWindow(WindowPtr pWin);
|
---|
1296 |
|
---|
1297 | extern _X_EXPORT Bool
|
---|
1298 | fbRealizeWindow(WindowPtr pWindow);
|
---|
1299 |
|
---|
1300 | extern _X_EXPORT Bool
|
---|
1301 | fbPositionWindow(WindowPtr pWin, int x, int y);
|
---|
1302 |
|
---|
1303 | extern _X_EXPORT Bool
|
---|
1304 | fbUnrealizeWindow(WindowPtr pWindow);
|
---|
1305 |
|
---|
1306 | extern _X_EXPORT void
|
---|
1307 |
|
---|
1308 | fbCopyWindowProc(DrawablePtr pSrcDrawable,
|
---|
1309 | DrawablePtr pDstDrawable,
|
---|
1310 | GCPtr pGC,
|
---|
1311 | BoxPtr pbox,
|
---|
1312 | int nbox,
|
---|
1313 | int dx,
|
---|
1314 | int dy,
|
---|
1315 | Bool reverse, Bool upsidedown, Pixel bitplane, void *closure);
|
---|
1316 |
|
---|
1317 | extern _X_EXPORT void
|
---|
1318 | fbCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc);
|
---|
1319 |
|
---|
1320 | extern _X_EXPORT Bool
|
---|
1321 | fbChangeWindowAttributes(WindowPtr pWin, unsigned long mask);
|
---|
1322 |
|
---|
1323 | extern _X_EXPORT void
|
---|
1324 |
|
---|
1325 | fbFillRegionSolid(DrawablePtr pDrawable,
|
---|
1326 | RegionPtr pRegion, FbBits and, FbBits xor);
|
---|
1327 |
|
---|
1328 | extern _X_EXPORT pixman_image_t *image_from_pict(PicturePtr pict,
|
---|
1329 | Bool has_clip,
|
---|
1330 | int *xoff, int *yoff);
|
---|
1331 |
|
---|
1332 | extern _X_EXPORT void free_pixman_pict(PicturePtr, pixman_image_t *);
|
---|
1333 |
|
---|
1334 | #endif /* _FB_H_ */
|
---|