summaryrefslogtreecommitdiff
path: root/dviware/beebe/src/clrbmap.h
blob: 33033fc1860fc4b9c186c3a04da85a02d8a60b58 (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
52
53
/* -*-C-*- clrbmap.h */
/*-->clrbmap*/
/**********************************************************************/
/****************************** clrbmap *******************************/
/**********************************************************************/

void
clrbmap()

{
#if    SEGMEM
    register INT16 x,y;		/* loop indices */
    register UNSIGN32 *p;	/* bitmap pointer */

    for (y = 0; y < YBIT; ++y)
    {
        p = (UNSIGN32*)BITMAP(y,0);

#if    FASTZERO
	(void)zerom(p,(UNSIGN32)(XBIT));
#else
	for (x = 0; x < XBIT; (++p,++x))
	    *p = (UNSIGN32)0;
#endif

    }

#else /* NOT SEGMEM */
#if    FASTZERO

/***********************************************************************
Fast assembly  language clear  -- runtime  histogramming showed  24%  of
total time was spent  in this routine for  the large bitmap required  by
the Toshiba P1315 180 dpi dvi driver!
***********************************************************************/
    (void)zerom(bitmap,(UNSIGN32)(XBIT*YBIT));

#else /* NOT FASTZERO */


    register INT32 nword;	/* loop index */
    register UNSIGN32 *p;	/* bitmap pointer */

    p = (UNSIGN32*)BITMAP(YBIT-1,XBIT-1);	/* the last element */

    for (nword = (XBIT*YBIT); nword; (--nword,--p))
	*p = (UNSIGN32)0;

#endif /* FASTZERO */

#endif /* SEGMEM */
}