VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/7.0/xorg/afb.h@ 37801

最後變更 在這個檔案從37801是 17236,由 vboxsync 提交於 16 年 前

Additions/x11/x11include: blast! Reverted r43555 and r43556

  • 屬性 svn:eol-style 設為 native
檔案大小: 25.0 KB
 
1/* $XFree86: xc/programs/Xserver/afb/afb.h,v 3.10 2003/10/29 22:15:19 tsi Exp $ */
2/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
3/***********************************************************
4
5Copyright (c) 1987 X Consortium
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in
15all copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
24Except as contained in this notice, the name of the X Consortium shall not be
25used in advertising or otherwise to promote the sale, use or other dealings
26in this Software without prior written authorization from the X Consortium.
27
28
29Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
30
31 All Rights Reserved
32
33Permission to use, copy, modify, and distribute this software and its
34documentation for any purpose and without fee is hereby granted,
35provided that the above copyright notice appear in all copies and that
36both that copyright notice and this permission notice appear in
37supporting documentation, and that the name of Digital not be
38used in advertising or publicity pertaining to distribution of the
39software without specific, written prior permission.
40
41DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
42ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
43DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
44ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
45WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
46ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
47SOFTWARE.
48
49******************************************************************/
50/* $XConsortium: afb.h,v 5.31 94/04/17 20:28:15 dpw Exp $ */
51/* Monochrome Frame Buffer definitions
52 written by drewry, september 1986
53*/
54
55#include "pixmap.h"
56#include "region.h"
57#include "gc.h"
58#include "colormap.h"
59#include "regionstr.h"
60#include "mibstore.h"
61#include "mfb.h"
62
63extern int afbInverseAlu[];
64extern int afbScreenPrivateIndex;
65/* warning: PixelType definition duplicated in maskbits.h */
66#ifndef PixelType
67#define PixelType CARD32
68#endif /* PixelType */
69
70#define AFB_MAX_DEPTH 8
71
72/* afbbitblt.c */
73
74extern void afbDoBitblt(
75 DrawablePtr /*pSrc*/,
76 DrawablePtr /*pDst*/,
77 int /*alu*/,
78 RegionPtr /*prgnDst*/,
79 DDXPointPtr /*pptSrc*/,
80 unsigned long /*planemask*/
81);
82
83extern RegionPtr afbBitBlt(
84 DrawablePtr /*pSrc*/,
85 DrawablePtr /*pDst*/,
86 GCPtr /*pGC*/,
87 int /*srcx*/,
88 int /*srcy*/,
89 int /*width*/,
90 int /*height*/,
91 int /*dstx*/,
92 int /*dsty*/,
93 void (*doBitBlt)(
94 DrawablePtr /*pSrc*/,
95 DrawablePtr /*pDst*/,
96 int /*alu*/,
97 RegionPtr /*prgnDst*/,
98 DDXPointPtr /*pptSrc*/,
99 unsigned long /*planemask*/
100 ),
101 unsigned long /*planemask*/
102);
103
104extern RegionPtr afbCopyArea(
105 DrawablePtr /*pSrcDrawable*/,
106 DrawablePtr /*pDstDrawable*/,
107 GCPtr/*pGC*/,
108 int /*srcx*/,
109 int /*srcy*/,
110 int /*width*/,
111 int /*height*/,
112 int /*dstx*/,
113 int /*dsty*/
114);
115
116extern RegionPtr afbCopyPlane(
117 DrawablePtr /*pSrcDrawable*/,
118 DrawablePtr /*pDstDrawable*/,
119 GCPtr/*pGC*/,
120 int /*srcx*/,
121 int /*srcy*/,
122 int /*width*/,
123 int /*height*/,
124 int /*dstx*/,
125 int /*dsty*/,
126 unsigned long /*plane*/
127);
128
129extern void afbCopy1ToN(
130 DrawablePtr /*pSrc*/,
131 DrawablePtr /*pDst*/,
132 int /*alu*/,
133 RegionPtr /*prgnDst*/,
134 DDXPointPtr /*pptSrc*/,
135 unsigned long /*planemask*/
136);
137/* afbbltC.c */
138
139extern void afbDoBitbltCopy(
140 DrawablePtr /*pSrc*/,
141 DrawablePtr /*pDst*/,
142 int /*alu*/,
143 RegionPtr /*prgnDst*/,
144 DDXPointPtr /*pptSrc*/,
145 unsigned long /*planemask*/
146);
147/* afbbltCI.c */
148
149extern void afbDoBitbltCopyInverted(
150 DrawablePtr /*pSrc*/,
151 DrawablePtr /*pDst*/,
152 int /*alu*/,
153 RegionPtr /*prgnDst*/,
154 DDXPointPtr /*pptSrc*/,
155 unsigned long /*planemask*/
156);
157/* afbbltG.c */
158
159extern void afbDoBitbltGeneral(
160 DrawablePtr /*pSrc*/,
161 DrawablePtr /*pDst*/,
162 int /*alu*/,
163 RegionPtr /*prgnDst*/,
164 DDXPointPtr /*pptSrc*/,
165 unsigned long /*planemask*/
166);
167/* afbbltO.c */
168
169extern void afbDoBitbltOr(
170 DrawablePtr /*pSrc*/,
171 DrawablePtr /*pDst*/,
172 int /*alu*/,
173 RegionPtr /*prgnDst*/,
174 DDXPointPtr /*pptSrc*/,
175 unsigned long /*planemask*/
176);
177/* afbbltX.c */
178
179extern void afbDoBitbltXor(
180 DrawablePtr /*pSrc*/,
181 DrawablePtr /*pDst*/,
182 int /*alu*/,
183 RegionPtr /*prgnDst*/,
184 DDXPointPtr /*pptSrc*/,
185 unsigned long /*planemask*/
186);
187/* afbbres.c */
188
189extern void afbBresS(
190 PixelType * /*addrl*/,
191 int /*nlwidth*/,
192 int /*sizeDst*/,
193 int /*depthDst*/,
194 int /*signdx*/,
195 int /*signdy*/,
196 int /*axis*/,
197 int /*x1*/,
198 int /*y1*/,
199 int /*e*/,
200 int /*e1*/,
201 int /*e2*/,
202 int /*len*/,
203 unsigned char * /*rrops*/
204);
205/* afbbresd.c */
206
207extern void afbBresD(
208 int * /*pdashIndex*/,
209 unsigned char * /*pDash*/,
210 int /*numInDashList*/,
211 int * /*pdashOffset*/,
212 int /*isDoubleDash*/,
213 PixelType * /*addrl*/,
214 int /*nlwidth*/,
215 int /*sizeDst*/,
216 int /*depthDst*/,
217 int /*signdx*/,
218 int /*signdy*/,
219 int /*axis*/,
220 int /*x1*/,
221 int /*y1*/,
222 int /*e*/,
223 int /*e1*/,
224 int /*e2*/,
225 int /*len*/,
226 unsigned char * /*rrops*/,
227 unsigned char * /*bgrrops*/
228);
229/* afbbstore.c */
230
231extern void afbSaveAreas(
232 PixmapPtr /*pPixmap*/,
233 RegionPtr /*prgnSave*/,
234 int /*xorg*/,
235 int /*yorg*/,
236 WindowPtr /*pWin*/
237);
238
239extern void afbRestoreAreas(
240 PixmapPtr /*pPixmap*/,
241 RegionPtr /*prgnRestore*/,
242 int /*xorg*/,
243 int /*yorg*/,
244 WindowPtr /*pWin*/
245);
246/* afbclip.c */
247
248extern RegionPtr afbPixmapToRegion(
249 PixmapPtr /*pPix*/
250);
251
252/* afbcmap.c */
253
254extern int afbListInstalledColormaps(
255 ScreenPtr /*pScreen*/,
256 Colormap * /*pmaps*/
257);
258
259extern void afbInstallColormap(
260 ColormapPtr /*pmap*/
261);
262
263extern void afbUninstallColormap(
264 ColormapPtr /*pmap*/
265);
266
267extern void afbResolveColor(
268 unsigned short * /*pred*/,
269 unsigned short * /*pgreen*/,
270 unsigned short * /*pblue*/,
271 VisualPtr /*pVisual*/
272);
273
274extern Bool afbInitializeColormap(
275 ColormapPtr /*pmap*/
276);
277
278extern int afbExpandDirectColors(
279 ColormapPtr /*pmap*/,
280 int /*ndefs*/,
281 xColorItem * /*indefs*/,
282 xColorItem * /*outdefs*/
283);
284
285extern Bool afbCreateDefColormap(
286 ScreenPtr /*pScreen*/
287);
288
289extern Bool afbSetVisualTypes(
290 int /*depth*/,
291 int /*visuals*/,
292 int /*bitsPerRGB*/
293);
294
295extern Bool afbInitVisuals(
296 VisualPtr * /*visualp*/,
297 DepthPtr * /*depthp*/,
298 int * /*nvisualp*/,
299 int * /*ndepthp*/,
300 int * /*rootDepthp*/,
301 VisualID * /*defaultVisp*/,
302 unsigned long /*sizes*/,
303 int /*bitsPerRGB*/
304);
305
306/* afbfillarc.c */
307
308extern void afbPolyFillArcSolid(
309 DrawablePtr /*pDraw*/,
310 GCPtr /*pGC*/,
311 int /*narcs*/,
312 xArc * /*parcs*/
313);
314/* afbfillrct.c */
315
316extern void afbPolyFillRect(
317 DrawablePtr /*pDrawable*/,
318 GCPtr /*pGC*/,
319 int /*nrectFill*/,
320 xRectangle * /*prectInit*/
321);
322
323/* afbply1rct.c */
324extern void afbFillPolygonSolid(
325 DrawablePtr /*pDrawable*/,
326 GCPtr /*pGC*/,
327 int /*mode*/,
328 int /*shape*/,
329 int /*count*/,
330 DDXPointPtr /*ptsIn*/
331);
332
333/* afbfillsp.c */
334
335extern void afbSolidFS(
336 DrawablePtr /*pDrawable*/,
337 GCPtr /*pGC*/,
338 int /*nInit*/,
339 DDXPointPtr /*pptInit*/,
340 int * /*pwidthInit*/,
341 int /*fSorted*/
342);
343
344extern void afbStippleFS(
345 DrawablePtr /*pDrawable*/,
346 GCPtr/*pGC*/,
347 int /*nInit*/,
348 DDXPointPtr /*pptInit*/,
349 int * /*pwidthInit*/,
350 int /*fSorted*/
351);
352
353extern void afbTileFS(
354 DrawablePtr /*pDrawable*/,
355 GCPtr/*pGC*/,
356 int /*nInit*/,
357 DDXPointPtr /*pptInit*/,
358 int * /*pwidthInit*/,
359 int /*fSorted*/
360);
361
362extern void afbUnnaturalTileFS(
363 DrawablePtr /*pDrawable*/,
364 GCPtr/*pGC*/,
365 int /*nInit*/,
366 DDXPointPtr /*pptInit*/,
367 int * /*pwidthInit*/,
368 int /*fSorted*/
369);
370
371extern void afbUnnaturalStippleFS(
372 DrawablePtr /*pDrawable*/,
373 GCPtr/*pGC*/,
374 int /*nInit*/,
375 DDXPointPtr /*pptInit*/,
376 int * /*pwidthInit*/,
377 int /*fSorted*/
378);
379
380extern void afbOpaqueStippleFS(
381 DrawablePtr /*pDrawable*/,
382 GCPtr/*pGC*/,
383 int /*nInit*/,
384 DDXPointPtr /*pptInit*/,
385 int * /*pwidthInit*/,
386 int /*fSorted*/
387);
388
389extern void afbUnnaturalOpaqueStippleFS(
390 DrawablePtr /*pDrawable*/,
391 GCPtr/*pGC*/,
392 int /*nInit*/,
393 DDXPointPtr /*pptInit*/,
394 int * /*pwidthInit*/,
395 int /*fSorted*/
396);
397
398/* afbfont.c */
399
400extern Bool afbRealizeFont(
401 ScreenPtr /*pscr*/,
402 FontPtr /*pFont*/
403);
404
405extern Bool afbUnrealizeFont(
406 ScreenPtr /*pscr*/,
407 FontPtr /*pFont*/
408);
409/* afbgc.c */
410
411extern Bool afbCreateGC(
412 GCPtr /*pGC*/
413);
414
415extern void afbValidateGC(
416 GCPtr /*pGC*/,
417 unsigned long /*changes*/,
418 DrawablePtr /*pDrawable*/
419);
420
421extern void afbDestroyGC(
422 GCPtr /*pGC*/
423);
424
425extern void afbReduceRop(
426 int /*alu*/,
427 Pixel /*src*/,
428 unsigned long /*planemask*/,
429 int /*depth*/,
430 unsigned char * /*rrops*/
431);
432
433extern void afbReduceOpaqueStipple (
434 Pixel /*fg*/,
435 Pixel /*bg*/,
436 unsigned long /*planemask*/,
437 int /*depth*/,
438 unsigned char * /*rrops*/
439);
440
441extern void afbComputeCompositeClip(
442 GCPtr /*pGC*/,
443 DrawablePtr /*pDrawable*/
444);
445
446/* afbgetsp.c */
447
448extern void afbGetSpans(
449 DrawablePtr /*pDrawable*/,
450 int /*wMax*/,
451 DDXPointPtr /*ppt*/,
452 int * /*pwidth*/,
453 int /*nspans*/,
454 char * /*pdstStart*/
455);
456/* afbhrzvert.c */
457
458extern void afbHorzS(
459 PixelType * /*addrl*/,
460 int /*nlwidth*/,
461 int /*sizeDst*/,
462 int /*depthDst*/,
463 int /*x1*/,
464 int /*y1*/,
465 int /*len*/,
466 unsigned char * /*rrops*/
467);
468
469extern void afbVertS(
470 PixelType * /*addrl*/,
471 int /*nlwidth*/,
472 int /*sizeDst*/,
473 int /*depthDst*/,
474 int /*x1*/,
475 int /*y1*/,
476 int /*len*/,
477 unsigned char * /*rrops*/
478);
479/* afbigbblak.c */
480
481extern void afbImageGlyphBlt (
482 DrawablePtr /*pDrawable*/,
483 GCPtr/*pGC*/,
484 int /*x*/,
485 int /*y*/,
486 unsigned int /*nglyph*/,
487 CharInfoPtr * /*ppci*/,
488 pointer /*pglyphBase*/
489);
490/* afbigbwht.c */
491
492/* afbimage.c */
493
494extern void afbPutImage(
495 DrawablePtr /*dst*/,
496 GCPtr /*pGC*/,
497 int /*depth*/,
498 int /*x*/,
499 int /*y*/,
500 int /*w*/,
501 int /*h*/,
502 int /*leftPad*/,
503 int /*format*/,
504 char * /*pImage*/
505);
506
507extern void afbGetImage(
508 DrawablePtr /*pDrawable*/,
509 int /*sx*/,
510 int /*sy*/,
511 int /*w*/,
512 int /*h*/,
513 unsigned int /*format*/,
514 unsigned long /*planeMask*/,
515 char * /*pdstLine*/
516);
517/* afbline.c */
518
519extern void afbLineSS(
520 DrawablePtr /*pDrawable*/,
521 GCPtr /*pGC*/,
522 int /*mode*/,
523 int /*npt*/,
524 DDXPointPtr /*pptInit*/
525);
526
527extern void afbLineSD(
528 DrawablePtr /*pDrawable*/,
529 GCPtr /*pGC*/,
530 int /*mode*/,
531 int /*npt*/,
532 DDXPointPtr /*pptInit*/
533);
534
535/* afbmisc.c */
536
537extern void afbQueryBestSize(
538 int /*class*/,
539 unsigned short * /*pwidth*/,
540 unsigned short * /*pheight*/,
541 ScreenPtr /*pScreen*/
542);
543/* afbpntarea.c */
544
545extern void afbSolidFillArea(
546 DrawablePtr /*pDraw*/,
547 int /*nbox*/,
548 BoxPtr /*pbox*/,
549 unsigned char * /*rrops*/
550);
551
552extern void afbStippleAreaPPW(
553 DrawablePtr /*pDraw*/,
554 int /*nbox*/,
555 BoxPtr /*pbox*/,
556 PixmapPtr /*pstipple*/,
557 unsigned char * /*rrops*/
558);
559extern void afbStippleArea(
560 DrawablePtr /*pDraw*/,
561 int /*nbox*/,
562 BoxPtr /*pbox*/,
563 PixmapPtr /*pstipple*/,
564 int /*xOff*/,
565 int /*yOff*/,
566 unsigned char * /*rrops*/
567);
568/* afbplygblt.c */
569
570extern void afbPolyGlyphBlt(
571 DrawablePtr /*pDrawable*/,
572 GCPtr /*pGC*/,
573 int /*x*/,
574 int /*y*/,
575 unsigned int /*nglyph*/,
576 CharInfoPtr * /*ppci*/,
577 pointer /*pglyphBase*/
578);
579
580/* afbpixmap.c */
581
582extern PixmapPtr afbCreatePixmap(
583 ScreenPtr /*pScreen*/,
584 int /*width*/,
585 int /*height*/,
586 int /*depth*/
587);
588
589extern Bool afbDestroyPixmap(
590 PixmapPtr /*pPixmap*/
591);
592
593extern PixmapPtr afbCopyPixmap(
594 PixmapPtr /*pSrc*/
595);
596
597extern void afbPadPixmap(
598 PixmapPtr /*pPixmap*/
599);
600
601extern void afbXRotatePixmap(
602 PixmapPtr /*pPix*/,
603 int /*rw*/
604);
605
606extern void afbYRotatePixmap(
607 PixmapPtr /*pPix*/,
608 int /*rh*/
609);
610
611extern void afbCopyRotatePixmap(
612 PixmapPtr /*psrcPix*/,
613 PixmapPtr * /*ppdstPix*/,
614 int /*xrot*/,
615 int /*yrot*/
616);
617extern void afbPaintWindow(
618 WindowPtr /*pWin*/,
619 RegionPtr /*pRegion*/,
620 int /*what*/
621);
622/* afbpolypnt.c */
623
624extern void afbPolyPoint(
625 DrawablePtr /*pDrawable*/,
626 GCPtr /*pGC*/,
627 int /*mode*/,
628 int /*npt*/,
629 xPoint * /*pptInit*/
630);
631/* afbpushpxl.c */
632
633extern void afbPushPixels(
634 GCPtr /*pGC*/,
635 PixmapPtr /*pBitMap*/,
636 DrawablePtr /*pDrawable*/,
637 int /*dx*/,
638 int /*dy*/,
639 int /*xOrg*/,
640 int /*yOrg*/
641);
642/* afbscrclse.c */
643
644extern Bool afbCloseScreen(
645 int /*index*/,
646 ScreenPtr /*pScreen*/
647);
648/* afbscrinit.c */
649
650extern Bool afbAllocatePrivates(
651 ScreenPtr /*pScreen*/,
652 int * /*pWinIndex*/,
653 int * /*pGCIndex*/
654);
655
656extern Bool afbScreenInit(
657 ScreenPtr /*pScreen*/,
658 pointer /*pbits*/,
659 int /*xsize*/,
660 int /*ysize*/,
661 int /*dpix*/,
662 int /*dpiy*/,
663 int /*width*/
664);
665
666extern PixmapPtr afbGetWindowPixmap(
667 WindowPtr /*pWin*/
668);
669
670extern void afbSetWindowPixmap(
671 WindowPtr /*pWin*/,
672 PixmapPtr /*pPix*/
673);
674
675/* afbseg.c */
676
677extern void afbSegmentSS(
678 DrawablePtr /*pDrawable*/,
679 GCPtr /*pGC*/,
680 int /*nseg*/,
681 xSegment * /*pSeg*/
682);
683
684extern void afbSegmentSD(
685 DrawablePtr /*pDrawable*/,
686 GCPtr /*pGC*/,
687 int /*nseg*/,
688 xSegment * /*pSeg*/
689);
690/* afbsetsp.c */
691
692extern void afbSetScanline(
693 int /*y*/,
694 int /*xOrigin*/,
695 int /*xStart*/,
696 int /*xEnd*/,
697 PixelType * /*psrc*/,
698 int /*alu*/,
699 PixelType * /*pdstBase*/,
700 int /*widthDst*/,
701 int /*sizeDst*/,
702 int /*depthDst*/,
703 int /*sizeSrc*/
704);
705
706extern void afbSetSpans(
707 DrawablePtr /*pDrawable*/,
708 GCPtr /*pGC*/,
709 char * /*psrc*/,
710 DDXPointPtr /*ppt*/,
711 int * /*pwidth*/,
712 int /*nspans*/,
713 int /*fSorted*/
714);
715/* afbtegblt.c */
716
717extern void afbTEGlyphBlt(
718 DrawablePtr /*pDrawable*/,
719 GCPtr/*pGC*/,
720 int /*x*/,
721 int /*y*/,
722 unsigned int /*nglyph*/,
723 CharInfoPtr * /*ppci*/,
724 pointer /*pglyphBase*/
725);
726/* afbtileC.c */
727
728extern void afbTileAreaPPWCopy(
729 DrawablePtr /*pDraw*/,
730 int /*nbox*/,
731 BoxPtr /*pbox*/,
732 int /*alu*/,
733 PixmapPtr /*ptile*/,
734 unsigned long /*planemask*/
735);
736/* afbtileG.c */
737
738extern void afbTileAreaPPWGeneral(
739 DrawablePtr /*pDraw*/,
740 int /*nbox*/,
741 BoxPtr /*pbox*/,
742 int /*alu*/,
743 PixmapPtr /*ptile*/,
744 unsigned long /*planemask*/
745);
746
747extern void afbTileAreaCopy(
748 DrawablePtr /*pDraw*/,
749 int /*nbox*/,
750 BoxPtr /*pbox*/,
751 int /*alu*/,
752 PixmapPtr /*ptile*/,
753 int /*xOff*/,
754 int /*yOff*/,
755 unsigned long /*planemask*/
756);
757/* afbtileG.c */
758
759extern void afbTileAreaGeneral(
760 DrawablePtr /*pDraw*/,
761 int /*nbox*/,
762 BoxPtr /*pbox*/,
763 int /*alu*/,
764 PixmapPtr /*ptile*/,
765 int /*xOff*/,
766 int /*yOff*/,
767 unsigned long /*planemask*/
768);
769
770extern void afbOpaqueStippleAreaPPWCopy(
771 DrawablePtr /*pDraw*/,
772 int /*nbox*/,
773 BoxPtr /*pbox*/,
774 int /*alu*/,
775 PixmapPtr /*ptile*/,
776 unsigned char */*rropsOS*/,
777 unsigned long /*planemask*/
778);
779/* afbtileG.c */
780
781extern void afbOpaqueStippleAreaPPWGeneral(
782 DrawablePtr /*pDraw*/,
783 int /*nbox*/,
784 BoxPtr /*pbox*/,
785 int /*alu*/,
786 PixmapPtr /*ptile*/,
787 unsigned char */*rropsOS*/,
788 unsigned long /*planemask*/
789);
790
791extern void afbOpaqueStippleAreaCopy(
792 DrawablePtr /*pDraw*/,
793 int /*nbox*/,
794 BoxPtr /*pbox*/,
795 int /*alu*/,
796 PixmapPtr /*ptile*/,
797 int /*xOff*/,
798 int /*yOff*/,
799 unsigned char */*rropsOS*/,
800 unsigned long /*planemask*/
801);
802/* afbtileG.c */
803
804extern void afbOpaqueStippleAreaGeneral(
805 DrawablePtr /*pDraw*/,
806 int /*nbox*/,
807 BoxPtr /*pbox*/,
808 int /*alu*/,
809 PixmapPtr /*ptile*/,
810 int /*xOff*/,
811 int /*yOff*/,
812 unsigned char */*rropsOS*/,
813 unsigned long /*planemask*/
814);
815
816/* afbwindow.c */
817
818extern Bool afbCreateWindow(
819 WindowPtr /*pWin*/
820);
821
822extern Bool afbDestroyWindow(
823 WindowPtr /*pWin*/
824);
825
826extern Bool afbMapWindow(
827 WindowPtr /*pWindow*/
828);
829
830extern Bool afbPositionWindow(
831 WindowPtr /*pWin*/,
832 int /*x*/,
833 int /*y*/
834);
835
836extern Bool afbUnmapWindow(
837 WindowPtr /*pWindow*/
838);
839
840extern void afbCopyWindow(
841 WindowPtr /*pWin*/,
842 DDXPointRec /*ptOldOrg*/,
843 RegionPtr /*prgnSrc*/
844);
845
846extern Bool afbChangeWindowAttributes(
847 WindowPtr /*pWin*/,
848 unsigned long /*mask*/
849);
850/* afbzerarc.c */
851
852extern void afbZeroPolyArcSS(
853 DrawablePtr /*pDraw*/,
854 GCPtr /*pGC*/,
855 int /*narcs*/,
856 xArc * /*parcs*/
857);
858
859/*
860 private field of pixmap
861 pixmap.devPrivate = (PixelType *)pointer_to_bits
862 pixmap.devKind = width_of_pixmap_in_bytes
863
864 private field of screen
865 a pixmap, for which we allocate storage. devPrivate is a pointer to
866the bits in the hardware framebuffer. note that devKind can be poked to
867make the code work for framebuffers that are wider than their
868displayable screen (e.g. the early vsII, which displayed 960 pixels
869across, but was 1024 in the hardware.)
870
871 private field of GC
872*/
873
874typedef struct {
875 unsigned char rrops[AFB_MAX_DEPTH]; /* reduction of rasterop to 1 of 3 */
876 unsigned char rropOS[AFB_MAX_DEPTH]; /* rop for opaque stipple */
877} afbPrivGC;
878typedef afbPrivGC *afbPrivGCPtr;
879
880extern int afbGCPrivateIndex; /* index into GC private array */
881extern int afbWindowPrivateIndex; /* index into Window private array */
882#ifdef PIXMAP_PER_WINDOW
883extern int frameWindowPrivateIndex; /* index into Window private array */
884#endif
885
886#define afbGetGCPrivate(pGC) \
887 ((afbPrivGC *)((pGC)->devPrivates[afbGCPrivateIndex].ptr))
888
889/* private field of window */
890typedef struct {
891 unsigned char fastBorder; /* non-zero if border tile is 32 bits wide */
892 unsigned char fastBackground;
893 unsigned short unused; /* pad for alignment with Sun compiler */
894 DDXPointRec oldRotate;
895 PixmapPtr pRotatedBackground;
896 PixmapPtr pRotatedBorder;
897} afbPrivWin;
898
899/* Common macros for extracting drawing information */
900
901#define afbGetTypedWidth(pDrawable,wtype)( \
902 (((pDrawable)->type == DRAWABLE_WINDOW) ? \
903 (int)(((PixmapPtr)((pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr))->devKind) : \
904 (int)(((PixmapPtr)pDrawable)->devKind)) / sizeof (wtype))
905
906#define afbGetByteWidth(pDrawable) afbGetTypedWidth(pDrawable, unsigned char)
907
908#define afbGetPixelWidth(pDrawable) afbGetTypedWidth(pDrawable, PixelType)
909
910#define afbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\
911 PixmapPtr _pPix; \
912 if ((pDrawable)->type == DRAWABLE_WINDOW) \
913 _pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
914 else \
915 _pPix = (PixmapPtr)(pDrawable); \
916 (pointer) = (ptype *) _pPix->devPrivate.ptr; \
917 (width) = ((int) _pPix->devKind) / sizeof (wtype); \
918}
919
920#define afbGetPixelWidthSizeDepthAndPointer(pDrawable, width, size, dep, pointer) {\
921 PixmapPtr _pPix; \
922 if ((pDrawable)->type == DRAWABLE_WINDOW) \
923 _pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
924 else \
925 _pPix = (PixmapPtr)(pDrawable); \
926 (pointer) = (PixelType *)_pPix->devPrivate.ptr; \
927 (width) = ((int)_pPix->devKind) / sizeof (PixelType); \
928 (size) = (width) * _pPix->drawable.height; \
929 (dep) = _pPix->drawable.depth; (void)(dep); \
930}
931
932#define afbGetByteWidthAndPointer(pDrawable, width, pointer) \
933 afbGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned char, unsigned char)
934
935#define afbGetPixelWidthAndPointer(pDrawable, width, pointer) \
936 afbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType)
937
938#define afbGetWindowTypedWidthAndPointer(pWin, width, pointer, wtype, ptype) {\
939 PixmapPtr _pPix = (PixmapPtr)(pWin)->drawable.pScreen->devPrivates[afbScreenPrivateIndex].ptr; \
940 (pointer) = (ptype *) _pPix->devPrivate.ptr; \
941 (width) = ((int) _pPix->devKind) / sizeof (wtype); \
942}
943
944#define afbGetWindowPixelWidthAndPointer(pWin, width, pointer) \
945 afbGetWindowTypedWidthAndPointer(pWin, width, pointer, PixelType, PixelType)
946
947#define afbGetWindowByteWidthAndPointer(pWin, width, pointer) \
948 afbGetWindowTypedWidthAndPointer(pWin, width, pointer, char, char)
949
950/* afb uses the following macros to calculate addresses in drawables.
951 * To support banked framebuffers, the macros come in four flavors.
952 * All four collapse into the same definition on unbanked devices.
953 *
954 * afbScanlineFoo - calculate address and do bank switching
955 * afbScanlineFooNoBankSwitch - calculate address, don't bank switch
956 * afbScanlineFooSrc - calculate address, switch source bank
957 * afbScanlineFooDst - calculate address, switch destination bank
958 */
959
960/* The NoBankSwitch versions are the same for banked and unbanked cases */
961
962#define afbScanlineIncNoBankSwitch(_ptr, _off) _ptr += (_off)
963#define afbScanlineOffsetNoBankSwitch(_ptr, _off) ((_ptr) + (_off))
964#define afbScanlineDeltaNoBankSwitch(_ptr, _y, _w) \
965 afbScanlineOffsetNoBankSwitch(_ptr, (_y) * (_w))
966#define afbScanlineNoBankSwitch(_ptr, _x, _y, _w) \
967 afbScanlineOffsetNoBankSwitch(_ptr, (_y) * (_w) + ((_x) >> MFB_PWSH))
968
969#ifdef MFB_LINE_BANK
970
971#include "afblinebank.h" /* get macro definitions from this file */
972
973#else /* !MFB_LINE_BANK - unbanked case */
974
975#define afbScanlineInc(_ptr, _off) afbScanlineIncNoBankSwitch(_ptr, _off)
976#define afbScanlineIncSrc(_ptr, _off) afbScanlineInc(_ptr, _off)
977#define afbScanlineIncDst(_ptr, _off) afbScanlineInc(_ptr, _off)
978
979#define afbScanlineOffset(_ptr, _off) afbScanlineOffsetNoBankSwitch(_ptr, _off)
980#define afbScanlineOffsetSrc(_ptr, _off) afbScanlineOffset(_ptr, _off)
981#define afbScanlineOffsetDst(_ptr, _off) afbScanlineOffset(_ptr, _off)
982
983#define afbScanlineSrc(_ptr, _x, _y, _w) afbScanline(_ptr, _x, _y, _w)
984#define afbScanlineDst(_ptr, _x, _y, _w) afbScanline(_ptr, _x, _y, _w)
985
986#define afbScanlineDeltaSrc(_ptr, _y, _w) afbScanlineDelta(_ptr, _y, _w)
987#define afbScanlineDeltaDst(_ptr, _y, _w) afbScanlineDelta(_ptr, _y, _w)
988
989#endif /* MFB_LINE_BANK */
990
991#define afbScanlineDelta(_ptr, _y, _w) \
992 afbScanlineOffset(_ptr, (_y) * (_w))
993
994#define afbScanline(_ptr, _x, _y, _w) \
995 afbScanlineOffset(_ptr, (_y) * (_w) + ((_x) >> MFB_PWSH))
996
997/* precomputed information about each glyph for GlyphBlt code.
998 this saves recalculating the per glyph information for each box.
999*/
1000
1001typedef struct _afbpos{
1002 int xpos; /* xposition of glyph's origin */
1003 int xchar; /* x position mod 32 */
1004 int leftEdge;
1005 int rightEdge;
1006 int topEdge;
1007 int bottomEdge;
1008 PixelType *pdstBase; /* longword with character origin */
1009 int widthGlyph; /* width in bytes of this glyph */
1010} afbTEXTPOS;
1011
1012/* reduced raster ops for afb */
1013#define RROP_BLACK GXclear
1014#define RROP_WHITE GXset
1015#define RROP_NOP GXnoop
1016#define RROP_INVERT GXinvert
1017#define RROP_COPY GXcopy
1018
1019/* macros for afbbitblt.c, afbfillsp.c
1020 these let the code do one switch on the rop per call, rather
1021 than a switch on the rop per item (span or rectangle.)
1022*/
1023
1024#define fnCLEAR(src, dst) (0)
1025#define fnAND(src, dst) (src & dst)
1026#define fnANDREVERSE(src, dst) (src & ~dst)
1027#define fnCOPY(src, dst) (src)
1028#define fnANDINVERTED(src, dst) (~src & dst)
1029#define fnNOOP(src, dst) (dst)
1030#define fnXOR(src, dst) (src ^ dst)
1031#define fnOR(src, dst) (src | dst)
1032#define fnNOR(src, dst) (~(src | dst))
1033#define fnEQUIV(src, dst) (~src ^ dst)
1034#define fnINVERT(src, dst) (~dst)
1035#define fnORREVERSE(src, dst) (src | ~dst)
1036#define fnCOPYINVERTED(src, dst) (~src)
1037#define fnORINVERTED(src, dst) (~src | dst)
1038#define fnNAND(src, dst) (~(src & dst))
1039#undef fnSET
1040#define fnSET(src, dst) (~0)
1041
1042/* Using a "switch" statement is much faster in most cases
1043 * since the compiler can do a look-up table or multi-way branch
1044 * instruction, depending on the architecture. The result on
1045 * A Sun 3/50 is at least 2.5 times faster, assuming a uniform
1046 * distribution of RasterOp operation types.
1047 *
1048 * However, doing some profiling on a running system reveals
1049 * GXcopy is the operation over 99.5% of the time and
1050 * GXxor is the next most frequent (about .4%), so we make special
1051 * checks for those first.
1052 *
1053 * Note that this requires a change to the "calling sequence"
1054 * since we can't engineer a "switch" statement to have an lvalue.
1055 */
1056#undef DoRop
1057#define DoRop(result, alu, src, dst) \
1058{ \
1059 if (alu == GXcopy) \
1060 result = fnCOPY (src, dst); \
1061 else if (alu == GXxor) \
1062 result = fnXOR (src, dst); \
1063 else \
1064 switch (alu) { \
1065 case GXclear: \
1066 result = fnCLEAR (src, dst); \
1067 break; \
1068 case GXand: \
1069 result = fnAND (src, dst); \
1070 break; \
1071 case GXandReverse: \
1072 result = fnANDREVERSE (src, dst); \
1073 break; \
1074 case GXandInverted: \
1075 result = fnANDINVERTED (src, dst); \
1076 break; \
1077 default: \
1078 case GXnoop: \
1079 result = fnNOOP (src, dst); \
1080 break; \
1081 case GXor: \
1082 result = fnOR (src, dst); \
1083 break; \
1084 case GXnor: \
1085 result = fnNOR (src, dst); \
1086 break; \
1087 case GXequiv: \
1088 result = fnEQUIV (src, dst); \
1089 break; \
1090 case GXinvert: \
1091 result = fnINVERT (src, dst); \
1092 break; \
1093 case GXorReverse: \
1094 result = fnORREVERSE (src, dst); \
1095 break; \
1096 case GXcopyInverted: \
1097 result = fnCOPYINVERTED (src, dst); \
1098 break; \
1099 case GXorInverted: \
1100 result = fnORINVERTED (src, dst); \
1101 break; \
1102 case GXnand: \
1103 result = fnNAND (src, dst); \
1104 break; \
1105 case GXset: \
1106 result = fnSET (src, dst); \
1107 break; \
1108 } \
1109}
1110
1111
1112/* C expression fragments for various operations. These get passed in
1113 * as -D's on the compile command line. See afb/Imakefile. This
1114 * fixes XBUG 6319.
1115 *
1116 * This seems like a good place to point out that afb's use of the
1117 * words black and white is an unfortunate misnomer. In afb code, black
1118 * means zero, and white means one.
1119 */
1120#define MFB_OPEQ_WHITE |=
1121#define MFB_OPEQ_BLACK &=~
1122#define MFB_OPEQ_INVERT ^=
1123#define MFB_EQWHOLEWORD_WHITE =~0
1124#define MFB_EQWHOLEWORD_BLACK =0
1125#define MFB_EQWHOLEWORD_INVERT ^=~0
1126#define MFB_OP_WHITE /* nothing */
1127#define MFB_OP_BLACK ~
1128
1129#ifdef XFree86LOADER
1130#include "xf86_ansic.h"
1131#endif
1132
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette