and add in the 8bpp gray stuff
[framework/uifw/evas.git] / src / lib / engines / common_8 / evas_soft8_scanline_fill.c
1 /** NOTE: This file is meant to be included by users **/
2
3 /*****************************************************************************
4  * Point processing
5  *
6  *    _soft8_pt_<description>_<src>_<dst>[_<modifier>]()
7  *
8  * Scanline processing
9  *
10  *    _soft8_scanline_<description>_<src>_<dst>[_<modifier>]()
11  *
12  ****************************************************************************/
13 static always_inline void
14 _soft8_pt_fill_solid_solid(DATA8 * dst, DATA8 gry8)
15 {
16    *dst = gry8;
17 }
18
19 static always_inline void
20 _soft8_scanline_fill_solid_solid(DATA8 * dst, int size, DATA8 gry8)
21 {
22    memset(dst, gry8, size);
23 }
24
25 static always_inline void
26 _soft8_pt_fill_transp_solid(DATA8 * dst, DATA8 gry8, DATA8 alpha)
27 {
28    *dst = GRY_8_BLEND(gry8, *dst, alpha);
29 }
30
31 static void
32 _soft8_scanline_fill_transp_solid(DATA8 * dst, int size, DATA8 gry8,
33                                   DATA8 alpha)
34 {
35    DATA8 *start, *end;
36
37    start = dst;
38    pld(start, 0);
39    end = start + (size & ~7);
40
41    while (start < end)
42      {
43         pld(start, 32);
44         UNROLL8(
45                   {
46                   _soft8_pt_fill_transp_solid(start, gry8, alpha); start++;}
47         );
48      }
49
50    end = start + (size & 7);
51    for (; start < end; start++)
52       _soft8_pt_fill_transp_solid(start, gry8, alpha);
53 }