2 * Copyright © 1998 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>
30 fbZeroLine (DrawablePtr pDrawable
,
44 dashOffset
= pGC
->dashOffset
;
50 if (mode
== CoordModePrevious
)
55 fbSegment (pDrawable
, pGC
, x1
+ x
, y1
+ y
,
57 npt
== 1 && pGC
->capStyle
!= CapNotLast
,
65 fbZeroSegment (DrawablePtr pDrawable
,
72 Bool drawLast
= pGC
->capStyle
!= CapNotLast
;
78 dashOffset
= pGC
->dashOffset
;
79 fbSegment (pDrawable
, pGC
,
80 pSegs
->x1
+ x
, pSegs
->y1
+ y
,
81 pSegs
->x2
+ x
, pSegs
->y2
+ y
,
89 fbFixCoordModePrevious (int npt
,
106 fbPolyLine (DrawablePtr pDrawable
,
112 void (*line
) (DrawablePtr
, GCPtr
, int mode
, int npt
, DDXPointPtr ppt
);
114 if (pGC
->lineWidth
== 0)
118 if (pGC
->fillStyle
== FillSolid
&&
119 pGC
->lineStyle
== LineSolid
&&
120 REGION_NUM_RECTS (fbGetCompositeClip(pGC
)) == 1)
122 switch (pDrawable
->bitsPerPixel
) {
123 case 8: line
= fbPolyline8
; break;
124 case 16: line
= fbPolyline16
; break;
126 case 24: line
= fbPolyline24
; break;
128 case 32: line
= fbPolyline32
; break;
135 if (pGC
->lineStyle
!= LineSolid
)
140 (*line
) (pDrawable
, pGC
, mode
, npt
, ppt
);
144 fbPolySegment (DrawablePtr pDrawable
,
149 void (*seg
) (DrawablePtr pDrawable
, GCPtr pGC
, int nseg
, xSegment
*pseg
);
151 if (pGC
->lineWidth
== 0)
155 if (pGC
->fillStyle
== FillSolid
&&
156 pGC
->lineStyle
== LineSolid
&&
157 REGION_NUM_RECTS (fbGetCompositeClip(pGC
)) == 1)
159 switch (pDrawable
->bitsPerPixel
) {
160 case 8: seg
= fbPolySegment8
; break;
161 case 16: seg
= fbPolySegment16
; break;
163 case 24: seg
= fbPolySegment24
; break;
165 case 32: seg
= fbPolySegment32
; break;
174 (*seg
) (pDrawable
, pGC
, nseg
, pseg
);