GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_display_driver_4bpp_horizontal_pixelmap_line_draw.c Lines: 230 230 100.0 %
Date: 2026-03-06 19:21:09 Branches: 128 128 100.0 %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 * Copyright (c) 2026-present Eclipse ThreadX contributors
4
 *
5
 * This program and the accompanying materials are made available under the
6
 * terms of the MIT License which is available at
7
 * https://opensource.org/licenses/MIT.
8
 *
9
 * SPDX-License-Identifier: MIT
10
 **************************************************************************/
11
12
13
/**************************************************************************/
14
/**************************************************************************/
15
/**                                                                       */
16
/** GUIX Component                                                        */
17
/**                                                                       */
18
/**   Display Management (Display)                                        */
19
/**                                                                       */
20
/**************************************************************************/
21
22
#define GX_SOURCE_CODE
23
24
25
/* Include necessary system files.  */
26
27
#include "gx_api.h"
28
#include "gx_display.h"
29
#include "gx_context.h"
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _gx_display_driver_4bpp_horizontal_pixelmap_line_raw_write          */
36
/*                                                        PORTABLE C      */
37
/*                                                           6.1          */
38
/*  AUTHOR                                                                */
39
/*                                                                        */
40
/*    Kenneth Maxwell, Microsoft Corporation                              */
41
/*                                                                        */
42
/*  DESCRIPTION                                                           */
43
/*                                                                        */
44
/*    Internal helper function that handles writing of uncompressed       */
45
/*    pixlemap file without transparency.                                 */
46
/*                                                                        */
47
/*  INPUT                                                                 */
48
/*                                                                        */
49
/*    context                               Drawing context               */
50
/*    xstart                                x-coord of line left          */
51
/*    xend                                  x-coord of line right         */
52
/*    y                                     y-coord of line top           */
53
/*    info                                  Pointer to                    */
54
/*                                            GX_FILL_PIXELMAP_INFO struct*/
55
/*                                                                        */
56
/*  OUTPUT                                                                */
57
/*                                                                        */
58
/*    None                                                                */
59
/*                                                                        */
60
/*  CALLS                                                                 */
61
/*                                                                        */
62
/*    None                                                                */
63
/*                                                                        */
64
/*  CALLED BY                                                             */
65
/*                                                                        */
66
/*    _gx_display_driver_4bpp_horizontal_pixelmap_line_draw               */
67
/*                                                                        */
68
/**************************************************************************/
69
17244
static VOID _gx_display_driver_4bpp_horizontal_pixelmap_line_raw_write(GX_DRAW_CONTEXT *context,
70
                                                                       INT xstart, INT xend, INT y, GX_FILL_PIXELMAP_INFO *info)
71
{
72
INT             xval;
73
const GX_UBYTE *get;
74
GX_UBYTE       *put;
75
GX_UBYTE        pixel;
76
GX_UBYTE        putmask;
77
INT             getstride;
78
INT             putstride;
79
INT             pic_width;
80
INT             offset;
81
GX_PIXELMAP    *pixelmap;
82
83
17244
    pixelmap = info -> pixelmap;
84
85
17244
    pic_width = pixelmap -> gx_pixelmap_width;
86
17244
    get = info -> current_pixel_ptr;
87
17244
    getstride = (pic_width + 1) >> 1;
88
89

17244
    if ((info -> draw) && (xstart <= xend))
90
    {
91
15008
        putstride = (context -> gx_draw_context_pitch + 1) >> 1;
92
15008
        put = (GX_UBYTE *)context -> gx_draw_context_memory;
93
15008
        put += y * putstride;
94
15008
        put += xstart >> 1;
95
96
15008
        if (xstart & 0x01)
97
        {
98
5639
            putmask = 0x0f;
99
        }
100
        else
101
        {
102
9369
            putmask = 0xf0;
103
        }
104
105
        /* Calculate the map offset in x-axis. */
106
15008
        offset = (info -> x_offset % pic_width);
107
108
1951651
        for (xval = xstart; xval <= xend; xval++)
109
        {
110
1936643
            pixel = *(get + (offset >> 1));
111
1936643
            if (offset & 1)
112
            {
113
967781
                pixel &= 0x0f;
114
967781
                pixel |= (GX_UBYTE)(pixel << 4);
115
            }
116
            else
117
            {
118
968862
                pixel &= 0xf0;
119
968862
                pixel |= pixel >> 4;
120
            }
121
1936643
            offset++;
122
123
1936643
            if (offset >= pic_width)
124
            {
125
4433
                offset -= pic_width;
126
            }
127
128
1936643
            *put &= (GX_UBYTE)(~putmask);
129
1936643
            *put |= putmask & pixel;
130
1936643
            putmask >>= 4;
131
1936643
            if (putmask == 0)
132
            {
133
966981
                put++;
134
966981
                putmask = 0xf0;
135
            }
136
        }
137
    }
138
139
    /* This line is drawn. Update the pointer position for next row. */
140
17244
    info -> current_pixel_ptr += (UINT)getstride * sizeof(GX_UBYTE);
141
17244
}
142
143
/**************************************************************************/
144
/*                                                                        */
145
/*  FUNCTION                                               RELEASE        */
146
/*                                                                        */
147
/*    _gx_display_driver_4bpp_horizontal_pixelmap_line_t_write            */
148
/*                                                        PORTABLE C      */
149
/*                                                           6.1          */
150
/*  AUTHOR                                                                */
151
/*                                                                        */
152
/*    Kenneth Maxwell, Microsoft Corporation                              */
153
/*                                                                        */
154
/*  DESCRIPTION                                                           */
155
/*                                                                        */
156
/*    Internal helper function that handles writing of uncompressed       */
157
/*    pixlemap file with transparency.                                    */
158
/*                                                                        */
159
/*  INPUT                                                                 */
160
/*                                                                        */
161
/*    context                               Drawing context               */
162
/*    xstart                                x-coord of line left          */
163
/*    xend                                  x-coord of line right         */
164
/*    y                                     y-coord of line top           */
165
/*    info                                  Pointer to                    */
166
/*                                            GX_FILL_PIXELMAP_INFO struct*/
167
/*                                                                        */
168
/*  OUTPUT                                                                */
169
/*                                                                        */
170
/*    None                                                                */
171
/*                                                                        */
172
/*  CALLS                                                                 */
173
/*                                                                        */
174
/*    None                                                                */
175
/*                                                                        */
176
/*  CALLED BY                                                             */
177
/*                                                                        */
178
/*    _gx_display_driver_4bpp_horizontal_pixelmap_line_draw               */
179
/*                                                                        */
180
/**************************************************************************/
181
16304
static VOID _gx_display_driver_4bpp_horizontal_pixelmap_line_transparent_write(GX_DRAW_CONTEXT *context,
182
                                                                               INT xstart, INT xend, INT y, GX_FILL_PIXELMAP_INFO *info)
183
{
184
INT             xval;
185
const GX_UBYTE *get;
186
const GX_UBYTE *getaux;
187
GX_UBYTE       *put;
188
GX_UBYTE        putmask;
189
GX_UBYTE        pixel;
190
GX_UBYTE        transmask;
191
INT             getstride;
192
INT             getauxstride;
193
INT             putstride;
194
INT             offset;
195
INT             pic_width;
196
16304
GX_PIXELMAP    *pixelmap = info -> pixelmap;
197
198
16304
    pixelmap = info -> pixelmap;
199
200
16304
    pic_width = pixelmap -> gx_pixelmap_width;
201
16304
    get = info -> current_pixel_ptr;
202
16304
    getaux = info -> current_aux_ptr;
203
16304
    getstride = (pic_width + 1) >> 1;
204
16304
    getauxstride = (pic_width + 7) >> 3;
205
206

16304
    if ((info -> draw) && (xstart <= xend))
207
    {
208
14160
        putstride = (context -> gx_draw_context_pitch + 1) >> 1;
209
14160
        put = (GX_UBYTE *)context -> gx_draw_context_memory;
210
14160
        put += y * putstride;
211
14160
        put += xstart >> 1;
212
14160
        if (xstart & 0x01)
213
        {
214
5358
            putmask = 0x0f;
215
        }
216
        else
217
        {
218
8802
            putmask = 0xf0;
219
        }
220
221
        /* Calculate the map offset in x-axis. */
222
14160
        offset = (info -> x_offset % pic_width);
223
224
1918492
        for (xval = xstart; xval <= xend; xval++)
225
        {
226
1904332
            transmask = (GX_UBYTE)(0x80 >> (offset & 0x07));
227
1904332
            if ((*(getaux + (offset >> 3)) & transmask) == 0)
228
            {
229
1361674
                pixel = *(get + (offset >> 1));
230
1361674
                if (offset & 1)
231
                {
232
680458
                    pixel &= 0x0f;
233
680458
                    pixel |= (GX_UBYTE)(pixel << 4);
234
                }
235
                else
236
                {
237
681216
                    pixel &= 0xf0;
238
681216
                    pixel |= pixel >> 4;
239
                }
240
1361674
                *put &= (GX_UBYTE)(~putmask);
241
1361674
                *put |= pixel & putmask;
242
            }
243
1904332
            offset++;
244
1904332
            if (offset >= pic_width)
245
            {
246
5934
                offset = 0;
247
            }
248
249
1904332
            putmask >>= 4;
250
1904332
            if (putmask == 0)
251
            {
252
950972
                putmask = 0xf0;
253
950972
                put++;
254
            }
255
        }
256
    }
257
258
    /* This line is drawn. Update the pointer position for next row. */
259
16304
    info -> current_pixel_ptr += (UINT)getstride * sizeof(GX_UBYTE);
260
16304
    info -> current_aux_ptr += (UINT)getauxstride * sizeof(GX_UBYTE);
261
16304
}
262
263
/**************************************************************************/
264
/*                                                                        */
265
/*  FUNCTION                                               RELEASE        */
266
/*                                                                        */
267
/*    _gx_display_driver_4bpp_horizontal_pixelmap_line_compressed_write   */
268
/*                                                        PORTABLE C      */
269
/*                                                           6.1          */
270
/*  AUTHOR                                                                */
271
/*                                                                        */
272
/*    Kenneth Maxwell, Microsoft Corporation                              */
273
/*                                                                        */
274
/*  DESCRIPTION                                                           */
275
/*                                                                        */
276
/*    Internal helper function that handles writing of compressed         */
277
/*    pixlemap file without transparent.                                  */
278
/*                                                                        */
279
/*  INPUT                                                                 */
280
/*                                                                        */
281
/*    context                               Drawing context               */
282
/*    xstart                                x-coord of line left          */
283
/*    xend                                  x-coord of line right         */
284
/*    y                                     y-coord of line top           */
285
/*    info                                  Pointer to                    */
286
/*                                            GX_FILL_PIXELMAP_INFO struct*/
287
/*                                                                        */
288
/*  OUTPUT                                                                */
289
/*                                                                        */
290
/*    None                                                                */
291
/*                                                                        */
292
/*  CALLS                                                                 */
293
/*                                                                        */
294
/*    None                                                                */
295
/*                                                                        */
296
/*  CALLED BY                                                             */
297
/*                                                                        */
298
/*    _gx_display_driver_4bpp_horizontal_pixelmap_line_draw               */
299
/*                                                                        */
300
/**************************************************************************/
301
18544
static VOID _gx_display_driver_4bpp_horizontal_pixelmap_line_compressed_write(GX_DRAW_CONTEXT *context,
302
                                                                              INT xstart, INT xend, INT y, GX_FILL_PIXELMAP_INFO *info)
303
{
304
INT                start_pos;
305
INT                xval;
306
GX_UBYTE           count;
307
18544
GX_CONST GX_UBYTE *get = GX_NULL;
308
18544
GX_CONST GX_UBYTE *get_count = GX_NULL;
309
GX_UBYTE           pixel;
310
GX_UBYTE           putmask;
311
GX_UBYTE          *put;
312
GX_PIXELMAP       *pixelmap;
313
18544
GX_UBYTE           getmask = 0;
314
315
18544
    pixelmap = info -> pixelmap;
316
317

18544
    if ((info -> draw) && (xstart <= xend))
318
    {
319
        /* This means it's the draw operation. */
320
        /* Skip the invisible pixels.*/
321
14798
        start_pos = xstart - (info -> x_offset % pixelmap -> gx_pixelmap_width);
322
323
14798
        put = (GX_UBYTE *)context -> gx_draw_context_memory;
324
14798
        put += y * ((context -> gx_draw_context_pitch + 1) >> 1) + (xstart >> 1);
325
326
14798
        if (xstart & 0x01)
327
        {
328
5638
            putmask = 0x0f;
329
        }
330
        else
331
        {
332
9160
            putmask = 0xf0;
333
        }
334
        /*Repeat the draw operation to fill the whole dirty area.*/
335
38414
        while (start_pos <= xend)
336
        {
337
23616
            xval = start_pos;
338
339
            /*Start from where we need to repeat.*/
340
23616
            get = (GX_CONST GX_UBYTE *)info -> current_pixel_ptr;
341
23616
            get_count = (GX_CONST GX_UBYTE *)info -> current_aux_ptr;
342
23616
            getmask = info -> mask;
343
344
2364446
            while (xval < start_pos + pixelmap -> gx_pixelmap_width)
345
            {
346
2340830
                count = *get_count++;
347
2340830
                if (count & 0x80)
348
                {
349
1418458
                    count = (GX_UBYTE)((count & 0x7f) + 1);
350
1418458
                    pixel = (GX_UBYTE)(*get & getmask);
351
1418458
                    if (getmask == 0xf0)
352
                    {
353
709466
                        pixel |= pixel >> 4;
354
                    }
355
                    else
356
                    {
357
708992
                        pixel |= (GX_UBYTE)(pixel << 4);
358
                    }
359
9572222
                    while (count--)
360
                    {
361

8153764
                        if (xval >= xstart && xval <= xend)
362
                        {
363
1289890
                            *put &= (GX_UBYTE)(~putmask);
364
1289890
                            *put |= (pixel & putmask);
365
1289890
                            putmask >>= 4;
366
1289890
                            if (putmask == 0)
367
                            {
368
643380
                                putmask = 0xf0;
369
643380
                                put++;
370
                            }
371
                        }
372
373
8153764
                        xval++;
374
                    }
375
1418458
                    getmask >>= 4;
376
1418458
                    if (getmask == 0)
377
                    {
378
708992
                        getmask = 0xf0;
379
708992
                        get++;
380
                    }
381
                }
382
                else
383
                {
384
922372
                    count++;
385
5442096
                    while (count--)
386
                    {
387

4519724
                        if (xval >= xstart && xval <= xend)
388
                        {
389
775180
                            pixel = (GX_UBYTE)(*get & getmask);
390
775180
                            if (getmask == 0xf0)
391
                            {
392
385408
                                pixel |= pixel >> 4;
393
                            }
394
                            else
395
                            {
396
389772
                                pixel |= (GX_UBYTE)(pixel << 4);
397
                            }
398
775180
                            *put &= (GX_UBYTE)(~putmask);
399
775180
                            *put |= (pixel & putmask);
400
401
775180
                            putmask >>= 4;
402
775180
                            if (putmask == 0)
403
                            {
404
387922
                                putmask = 0xf0;
405
387922
                                put++;
406
                            }
407
                        }
408
409
4519724
                        xval++;
410
4519724
                        getmask >>= 4;
411
4519724
                        if (getmask == 0)
412
                        {
413
2260068
                            getmask = 0xf0;
414
2260068
                            get++;
415
                        }
416
                    }
417
                }
418
            }
419
23616
            start_pos += pixelmap -> gx_pixelmap_width;
420
        }
421
    }
422
    else
423
    {
424
3746
        xval = 0;
425
3746
        get = (GX_CONST GX_UBYTE *)info -> current_pixel_ptr;
426
3746
        get_count = (GX_CONST GX_UBYTE *)info -> current_aux_ptr;
427
3746
        getmask = info -> mask;
428
614194
        while (xval < pixelmap -> gx_pixelmap_width)
429
        {
430
610448
            count = *get_count++;
431
610448
            if (count & 0x80)
432
            {
433
373166
                count = (GX_UBYTE)((count & 0x7f) + 1);
434
373166
                getmask >>= 4;      /* skip repeated pixel value */
435
373166
                if (getmask == 0)
436
                {
437
186612
                    get++;
438
186612
                    getmask = 0xf0;
439
                }
440
            }
441
            else
442
            {
443
237282
                count++;
444
445
237282
                get += count >> 1;
446

237282
                if ((getmask == 0x0f) && (count & 1))
447
                {
448
62304
                    get++;
449
                }
450
451
237282
                getmask = (GX_UBYTE)(getmask >> (GX_UBYTE)((count & 1) << 2));
452
237282
                if (getmask == 0)
453
                {
454
62304
                    getmask = 0xf0;
455
                }
456
                /* skip raw pixel values */
457
            }
458
610448
            xval += count;
459
        }
460
    }
461
462
    /* This line is drawn. cache the pointer for next line draw. */
463
18544
    info -> current_pixel_ptr = (GX_UBYTE *)get;
464
18544
    info -> current_aux_ptr = (GX_UBYTE *)get_count;
465
18544
    info -> mask = getmask;
466
18544
}
467
468
/**************************************************************************/
469
/*                                                                        */
470
/*  FUNCTION                                               RELEASE        */
471
/*                                                                        */
472
/*  _gx_display_driver_4bpp_horizontal_pixelmap_line_compressed_          */
473
/*  transparent_write                                                     */
474
/*                                                        PORTABLE C      */
475
/*                                                           6.1          */
476
/*  AUTHOR                                                                */
477
/*                                                                        */
478
/*    Kenneth Maxwell, Microsoft Corporation                              */
479
/*                                                                        */
480
/*  DESCRIPTION                                                           */
481
/*                                                                        */
482
/*    Internal helper function that handles writing of compressed         */
483
/*    pixlemap file with alpha channel.                                   */
484
/*                                                                        */
485
/*  INPUT                                                                 */
486
/*                                                                        */
487
/*    context                               Drawing context               */
488
/*    xstart                                x-coord of line left          */
489
/*    xend                                  x-coord of line right         */
490
/*    y                                     y-coord of line top           */
491
/*    info                                  Pointer to                    */
492
/*                                            GX_FILL_PIXELMAP_INFO struct*/
493
/*                                                                        */
494
/*  OUTPUT                                                                */
495
/*                                                                        */
496
/*    None                                                                */
497
/*                                                                        */
498
/*  CALLS                                                                 */
499
/*                                                                        */
500
/*    None                                                                */
501
/*                                                                        */
502
/*  CALLED BY                                                             */
503
/*                                                                        */
504
/*    _gx_display_driver_4bpp_horizontal_pixelmap_line_draw               */
505
/*                                                                        */
506
/**************************************************************************/
507
15986
static VOID _gx_display_driver_4bpp_horizontal_pixelmap_line_compressed_transparent_write(GX_DRAW_CONTEXT *context,
508
                                                                                          INT xstart, INT xend, INT y, GX_FILL_PIXELMAP_INFO *info)
509
{
510
INT                start_pos;
511
INT                xval;
512
GX_UBYTE           count;
513
15986
GX_CONST GX_UBYTE *get = GX_NULL;
514
15986
GX_CONST GX_UBYTE *get_count = GX_NULL;
515
GX_UBYTE           pixel;
516
GX_UBYTE          *put;
517
GX_PIXELMAP       *pixelmap;
518
GX_UBYTE           putmask;
519
520
15986
    pixelmap = info -> pixelmap;
521
522

15986
    if ((info -> draw) && (xstart <= xend))
523
    {
524
        /* This means it's the draw operation. */
525
        /* Skip the invisible pixels.*/
526
14160
        start_pos = xstart - (info -> x_offset % pixelmap -> gx_pixelmap_width);
527
528
14160
        put = (GX_UBYTE *)context -> gx_draw_context_memory;
529
14160
        put += y * ((context -> gx_draw_context_pitch + 1) >> 1) + (start_pos >> 1);
530
531
14160
        if (start_pos & 0x01)
532
        {
533
12552
            putmask = 0x0f;
534
        }
535
        else
536
        {
537
1608
            putmask = 0xf0;
538
        }
539
540
        /*Repeat the draw operation to fill the whole dirty area.*/
541
42494
        while (start_pos <= xend)
542
        {
543
28334
            xval = start_pos;
544
28334
            get = (GX_CONST GX_UBYTE *)info -> current_pixel_ptr;
545
28334
            get_count = (GX_CONST GX_UBYTE *)info -> current_aux_ptr;
546
200258
            while (xval < start_pos + pixelmap -> gx_pixelmap_width)
547
            {
548
171924
                count = *get_count++;
549
171924
                if (count & 0x80)
550
                {
551
108192
                    count = (GX_UBYTE)((count & 0x7f) + 1);
552
108192
                    pixel = *get++;
553
                    /* 0xff means transparent.*/
554
108192
                    if (pixel == 0xff)
555
                    {
556
54582
                        xval += count;
557
2364408
                        while (count--)
558
                        {
559
2309826
                            putmask >>= 4;
560
2309826
                            if (putmask == 0)
561
                            {
562
1154230
                                putmask = 0xf0;
563
1154230
                                put++;
564
                            }
565
                        }
566
                    }
567
                    else
568
                    {
569
53610
                        pixel |= (GX_UBYTE)(pixel << 4);
570
329620
                        while (count--)
571
                        {
572

276010
                            if (xval >= xstart && xval <= xend)
573
                            {
574
194456
                                *put &= (GX_UBYTE)(~putmask);
575
194456
                                *put |= (GX_UBYTE)(pixel & putmask);
576
                            }
577
276010
                            xval++;
578
276010
                            putmask >>= 4;
579
580
276010
                            if (putmask == 0)
581
                            {
582
138660
                                putmask = 0xf0;
583
138660
                                put++;
584
                            }
585
                        }
586
                    }
587
                }
588
                else
589
                {
590
63732
                    count++;
591
311296
                    while (count--)
592
                    {
593
247564
                        pixel = *get++;
594

247564
                        if (xval >= xstart && xval <= xend)
595
                        {
596
                            /* 0xff means transparent color, so should skip */
597
175708
                            if (pixel != 0xff)
598
                            {
599
174268
                                pixel |= (GX_UBYTE)(pixel << 4);
600
174268
                                *put &= (GX_UBYTE)(~putmask);
601
174268
                                *put |= (GX_UBYTE)(pixel & putmask);
602
                            }
603
                        }
604
605
247564
                        xval++;
606
247564
                        putmask >>= 4;
607
247564
                        if (putmask == 0)
608
                        {
609
123810
                            putmask = 0xf0;
610
123810
                            put++;
611
                        }
612
                    }
613
                }
614
            }
615
28334
            start_pos += pixelmap -> gx_pixelmap_width;
616
        }
617
    }
618
    else
619
    {
620
1826
        get = (GX_CONST GX_UBYTE *)info -> current_pixel_ptr;
621
1826
        get_count = (GX_CONST GX_UBYTE *)info -> current_aux_ptr;
622
1826
        xval = 0;
623
12122
        while (xval < pixelmap -> gx_pixelmap_width)
624
        {
625
10296
            count = *get_count++;
626
627
10296
            if (count & 0x80)
628
            {
629
6580
                count = (GX_UBYTE)((count & 0x7f) + 1);
630
6580
                get++;
631
            }
632
            else
633
            {
634
3716
                count++;
635
3716
                get += count;
636
            }
637
10296
            xval += count;
638
        }
639
    }
640
641
642
    /* This line is drawn. cache the pointer for next line draw. */
643
15986
    info -> current_pixel_ptr = (GX_UBYTE *)get;
644
15986
    info -> current_aux_ptr = (GX_UBYTE *)get_count;
645
15986
}
646
647
/**************************************************************************/
648
/*                                                                        */
649
/*  FUNCTION                                               RELEASE        */
650
/*                                                                        */
651
/*    _gx_display_driver_4bpp_horizontal_pixelmap_line_draw               */
652
/*                                                        PORTABLE C      */
653
/*                                                           6.1          */
654
/*  AUTHOR                                                                */
655
/*                                                                        */
656
/*    Kenneth Maxwell, Microsoft Corporation                              */
657
/*                                                                        */
658
/*  DESCRIPTION                                                           */
659
/*                                                                        */
660
/*    4bpp screen driver horizontal pixelmap line drawing function that   */
661
/*    handles compressed or uncompress, with or without alpha channel.    */
662
/*                                                                        */
663
/*  INPUT                                                                 */
664
/*                                                                        */
665
/*    context                               Drawing context               */
666
/*    xstart                                x-coord of line left          */
667
/*    xend                                  x-coord of line right         */
668
/*    y                                     y-coord of line top           */
669
/*    info                                  GX_FILL_PIXELMAP_INFO struct  */
670
/*                                                                        */
671
/*  OUTPUT                                                                */
672
/*                                                                        */
673
/*    None                                                                */
674
/*                                                                        */
675
/*  CALLS                                                                 */
676
/*                                                                        */
677
/*     _gx_display_driver_4bpp_horizontal_pixelmap_line_c_t_write         */
678
/*                                          Real display driver horizontal*/
679
/*                                            pixelmap line draw function */
680
/*     _gx_display_driver_4bpp_horizontal_pixelmap_line_t_write           */
681
/*                                          Real display driver horizontal*/
682
/*                                            pixelmap line draw function */
683
/*     _gx_display_driver_4bpp_horizontal_pixelmap_line_compressed_write  */
684
/*                                          Real display driver horizontal*/
685
/*                                            pixelmap line draw function */
686
/*     _gx_display_driver_4bpp_horizontal_pixelmap_line_raw_write         */
687
/*                                          Real display driver horizontal*/
688
/*                                            pixelmap line draw function */
689
/*                                                                        */
690
/*  CALLED BY                                                             */
691
/*                                                                        */
692
/*    GUIX Internal Code                                                  */
693
/*                                                                        */
694
/**************************************************************************/
695
68079
VOID _gx_display_driver_4bpp_horizontal_pixelmap_line_draw(GX_DRAW_CONTEXT *context,
696
                                                           INT xstart, INT xend, INT y, GX_FILL_PIXELMAP_INFO *info)
697
{
698
68079
GX_PIXELMAP *pixelmap = info -> pixelmap;
699
700
68079
    if (pixelmap == GX_NULL)
701
    {
702
1
        return;
703
    }
704
705
68078
    if (pixelmap -> gx_pixelmap_flags & GX_PIXELMAP_TRANSPARENT)
706
    {
707
32290
        if (pixelmap -> gx_pixelmap_flags & GX_PIXELMAP_COMPRESSED)
708
        {
709
            /* has both compression and alpha */
710
15986
            _gx_display_driver_4bpp_horizontal_pixelmap_line_compressed_transparent_write(context, xstart, xend, y, info);
711
        }
712
        else
713
        {
714
            /* alpha, no compression */
715
16304
            _gx_display_driver_4bpp_horizontal_pixelmap_line_transparent_write(context, xstart, xend, y, info);
716
        }
717
    }
718
    else
719
    {
720
35788
        if (pixelmap -> gx_pixelmap_flags & GX_PIXELMAP_COMPRESSED)
721
        {
722
            /* compressed with no alpha */
723
18544
            _gx_display_driver_4bpp_horizontal_pixelmap_line_compressed_write(context, xstart, xend, y, info);
724
        }
725
        else
726
        {
727
            /* no compression or alpha */
728
17244
            _gx_display_driver_4bpp_horizontal_pixelmap_line_raw_write(context, xstart, xend, y, info);
729
        }
730
    }
731
732
    /* Current pixelmap has gone over, so the offset pointer should be reset. */
733
68078
    if (info -> current_pixel_ptr >= info -> pixelmap -> gx_pixelmap_data + info -> pixelmap -> gx_pixelmap_data_size)
734
    {
735
274
        info -> current_pixel_ptr = (GX_UBYTE *)info ->  pixelmap -> gx_pixelmap_data;
736
274
        info -> current_aux_ptr = (GX_UBYTE *)info ->  pixelmap -> gx_pixelmap_aux_data;
737
    }
738
}
739