summaryrefslogtreecommitdiff
path: root/hw/xfree86/xf8_32bpp/cfbpntwin.c
blob: fbf597d2270246bda2b925bf43a3e7f6e9b9dfa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif

#include <X11/X.h>

#include "windowstr.h"
#include "regionstr.h"
#include "pixmapstr.h"
#include "scrnintstr.h"

#define PSZ 8
#include "cfb.h"
#undef PSZ
#include "cfb32.h"
#include "cfb8_32.h"
#include "mi.h"

#ifdef PANORAMIX
#include "panoramiX.h"
#include "panoramiXsrv.h"
#endif

void
cfb8_32FillBoxSolid8(
   DrawablePtr pDraw,
   int nbox,
   BoxPtr pbox,
   unsigned long color
){
    CARD8 *ptr, *data;
    int pitch, height, width, i;
    CARD8 c = (CARD8)color;

    cfbGetByteWidthAndPointer(pDraw, pitch, ptr);
    ptr += 3; /* point to the top byte */

    while(nbox--) {
	data = ptr + (pbox->y1 * pitch) + (pbox->x1 << 2);
	width = (pbox->x2 - pbox->x1) << 2;
	height = pbox->y2 - pbox->y1;

	while(height--) {
            for(i = 0; i < width; i+=4)
		data[i] = c;
            data += pitch;
	}
	pbox++;
    }
}