GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: gx_display_driver_4bpp_horizontal_pixelmap_line_draw.c Lines: 230 230 100.0 %
Date: 2024-12-05 08:52:37 Branches: 128 128 100.0 %

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

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

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

18544
    if ((info -> draw) && (xstart <= xend))
341
    {
342
        /* This means it's the draw operation. */
343
        /* Skip the invisible pixels.*/
344
14798
        start_pos = xstart - (info -> x_offset % pixelmap -> gx_pixelmap_width);
345
346
14798
        put = (GX_UBYTE *)context -> gx_draw_context_memory;
347
14798
        put += y * ((context -> gx_draw_context_pitch + 1) >> 1) + (xstart >> 1);
348
349
14798
        if (xstart & 0x01)
350
        {
351
5638
            putmask = 0x0f;
352
        }
353
        else
354
        {
355
9160
            putmask = 0xf0;
356
        }
357
        /*Repeat the draw operation to fill the whole dirty area.*/
358
38414
        while (start_pos <= xend)
359
        {
360
23616
            xval = start_pos;
361
362
            /*Start from where we need to repeat.*/
363
23616
            get = (GX_CONST GX_UBYTE *)info -> current_pixel_ptr;
364
23616
            get_count = (GX_CONST GX_UBYTE *)info -> current_aux_ptr;
365
23616
            getmask = info -> mask;
366
367
2364446
            while (xval < start_pos + pixelmap -> gx_pixelmap_width)
368
            {
369
2340830
                count = *get_count++;
370
2340830
                if (count & 0x80)
371
                {
372
1418458
                    count = (GX_UBYTE)((count & 0x7f) + 1);
373
1418458
                    pixel = (GX_UBYTE)(*get & getmask);
374
1418458
                    if (getmask == 0xf0)
375
                    {
376
709466
                        pixel |= pixel >> 4;
377
                    }
378
                    else
379
                    {
380
708992
                        pixel |= (GX_UBYTE)(pixel << 4);
381
                    }
382
9572222
                    while (count--)
383
                    {
384

8153764
                        if (xval >= xstart && xval <= xend)
385
                        {
386
1289890
                            *put &= (GX_UBYTE)(~putmask);
387
1289890
                            *put |= (pixel & putmask);
388
1289890
                            putmask >>= 4;
389
1289890
                            if (putmask == 0)
390
                            {
391
643380
                                putmask = 0xf0;
392
643380
                                put++;
393
                            }
394
                        }
395
396
8153764
                        xval++;
397
                    }
398
1418458
                    getmask >>= 4;
399
1418458
                    if (getmask == 0)
400
                    {
401
708992
                        getmask = 0xf0;
402
708992
                        get++;
403
                    }
404
                }
405
                else
406
                {
407
922372
                    count++;
408
5442096
                    while (count--)
409
                    {
410

4519724
                        if (xval >= xstart && xval <= xend)
411
                        {
412
775180
                            pixel = (GX_UBYTE)(*get & getmask);
413
775180
                            if (getmask == 0xf0)
414
                            {
415
385408
                                pixel |= pixel >> 4;
416
                            }
417
                            else
418
                            {
419
389772
                                pixel |= (GX_UBYTE)(pixel << 4);
420
                            }
421
775180
                            *put &= (GX_UBYTE)(~putmask);
422
775180
                            *put |= (pixel & putmask);
423
424
775180
                            putmask >>= 4;
425
775180
                            if (putmask == 0)
426
                            {
427
387922
                                putmask = 0xf0;
428
387922
                                put++;
429
                            }
430
                        }
431
432
4519724
                        xval++;
433
4519724
                        getmask >>= 4;
434
4519724
                        if (getmask == 0)
435
                        {
436
2260068
                            getmask = 0xf0;
437
2260068
                            get++;
438
                        }
439
                    }
440
                }
441
            }
442
23616
            start_pos += pixelmap -> gx_pixelmap_width;
443
        }
444
    }
445
    else
446
    {
447
3746
        xval = 0;
448
3746
        get = (GX_CONST GX_UBYTE *)info -> current_pixel_ptr;
449
3746
        get_count = (GX_CONST GX_UBYTE *)info -> current_aux_ptr;
450
3746
        getmask = info -> mask;
451
614194
        while (xval < pixelmap -> gx_pixelmap_width)
452
        {
453
610448
            count = *get_count++;
454
610448
            if (count & 0x80)
455
            {
456
373166
                count = (GX_UBYTE)((count & 0x7f) + 1);
457
373166
                getmask >>= 4;      /* skip repeated pixel value */
458
373166
                if (getmask == 0)
459
                {
460
186612
                    get++;
461
186612
                    getmask = 0xf0;
462
                }
463
            }
464
            else
465
            {
466
237282
                count++;
467
468
237282
                get += count >> 1;
469

237282
                if ((getmask == 0x0f) && (count & 1))
470
                {
471
62304
                    get++;
472
                }
473
474
237282
                getmask = (GX_UBYTE)(getmask >> (GX_UBYTE)((count & 1) << 2));
475
237282
                if (getmask == 0)
476
                {
477
62304
                    getmask = 0xf0;
478
                }
479
                /* skip raw pixel values */
480
            }
481
610448
            xval += count;
482
        }
483
    }
484
485
    /* This line is drawn. cache the pointer for next line draw. */
486
18544
    info -> current_pixel_ptr = (GX_UBYTE *)get;
487
18544
    info -> current_aux_ptr = (GX_UBYTE *)get_count;
488
18544
    info -> mask = getmask;
489
18544
}
490
491
/**************************************************************************/
492
/*                                                                        */
493
/*  FUNCTION                                               RELEASE        */
494
/*                                                                        */
495
/*  _gx_display_driver_4bpp_horizontal_pixelmap_line_compressed_          */
496
/*  transparent_write                                                     */
497
/*                                                        PORTABLE C      */
498
/*                                                           6.1          */
499
/*  AUTHOR                                                                */
500
/*                                                                        */
501
/*    Kenneth Maxwell, Microsoft Corporation                              */
502
/*                                                                        */
503
/*  DESCRIPTION                                                           */
504
/*                                                                        */
505
/*    Internal helper function that handles writing of compressed         */
506
/*    pixlemap file with alpha channel.                                   */
507
/*                                                                        */
508
/*  INPUT                                                                 */
509
/*                                                                        */
510
/*    context                               Drawing context               */
511
/*    xstart                                x-coord of line left          */
512
/*    xend                                  x-coord of line right         */
513
/*    y                                     y-coord of line top           */
514
/*    info                                  Pointer to                    */
515
/*                                            GX_FILL_PIXELMAP_INFO struct*/
516
/*                                                                        */
517
/*  OUTPUT                                                                */
518
/*                                                                        */
519
/*    None                                                                */
520
/*                                                                        */
521
/*  CALLS                                                                 */
522
/*                                                                        */
523
/*    None                                                                */
524
/*                                                                        */
525
/*  CALLED BY                                                             */
526
/*                                                                        */
527
/*    _gx_display_driver_4bpp_horizontal_pixelmap_line_draw               */
528
/*                                                                        */
529
/*  RELEASE HISTORY                                                       */
530
/*                                                                        */
531
/*    DATE              NAME                      DESCRIPTION             */
532
/*                                                                        */
533
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
534
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
535
/*                                            resulting in version 6.1    */
536
/*                                                                        */
537
/**************************************************************************/
538
15986
static VOID _gx_display_driver_4bpp_horizontal_pixelmap_line_compressed_transparent_write(GX_DRAW_CONTEXT *context,
539
                                                                                          INT xstart, INT xend, INT y, GX_FILL_PIXELMAP_INFO *info)
540
{
541
INT                start_pos;
542
INT                xval;
543
GX_UBYTE           count;
544
15986
GX_CONST GX_UBYTE *get = GX_NULL;
545
15986
GX_CONST GX_UBYTE *get_count = GX_NULL;
546
GX_UBYTE           pixel;
547
GX_UBYTE          *put;
548
GX_PIXELMAP       *pixelmap;
549
GX_UBYTE           putmask;
550
551
15986
    pixelmap = info -> pixelmap;
552
553

15986
    if ((info -> draw) && (xstart <= xend))
554
    {
555
        /* This means it's the draw operation. */
556
        /* Skip the invisible pixels.*/
557
14160
        start_pos = xstart - (info -> x_offset % pixelmap -> gx_pixelmap_width);
558
559
14160
        put = (GX_UBYTE *)context -> gx_draw_context_memory;
560
14160
        put += y * ((context -> gx_draw_context_pitch + 1) >> 1) + (start_pos >> 1);
561
562
14160
        if (start_pos & 0x01)
563
        {
564
12552
            putmask = 0x0f;
565
        }
566
        else
567
        {
568
1608
            putmask = 0xf0;
569
        }
570
571
        /*Repeat the draw operation to fill the whole dirty area.*/
572
42494
        while (start_pos <= xend)
573
        {
574
28334
            xval = start_pos;
575
28334
            get = (GX_CONST GX_UBYTE *)info -> current_pixel_ptr;
576
28334
            get_count = (GX_CONST GX_UBYTE *)info -> current_aux_ptr;
577
200258
            while (xval < start_pos + pixelmap -> gx_pixelmap_width)
578
            {
579
171924
                count = *get_count++;
580
171924
                if (count & 0x80)
581
                {
582
108192
                    count = (GX_UBYTE)((count & 0x7f) + 1);
583
108192
                    pixel = *get++;
584
                    /* 0xff means transparent.*/
585
108192
                    if (pixel == 0xff)
586
                    {
587
54582
                        xval += count;
588
2364408
                        while (count--)
589
                        {
590
2309826
                            putmask >>= 4;
591
2309826
                            if (putmask == 0)
592
                            {
593
1154230
                                putmask = 0xf0;
594
1154230
                                put++;
595
                            }
596
                        }
597
                    }
598
                    else
599
                    {
600
53610
                        pixel |= (GX_UBYTE)(pixel << 4);
601
329620
                        while (count--)
602
                        {
603

276010
                            if (xval >= xstart && xval <= xend)
604
                            {
605
194456
                                *put &= (GX_UBYTE)(~putmask);
606
194456
                                *put |= (GX_UBYTE)(pixel & putmask);
607
                            }
608
276010
                            xval++;
609
276010
                            putmask >>= 4;
610
611
276010
                            if (putmask == 0)
612
                            {
613
138660
                                putmask = 0xf0;
614
138660
                                put++;
615
                            }
616
                        }
617
                    }
618
                }
619
                else
620
                {
621
63732
                    count++;
622
311296
                    while (count--)
623
                    {
624
247564
                        pixel = *get++;
625

247564
                        if (xval >= xstart && xval <= xend)
626
                        {
627
                            /* 0xff means transparent color, so should skip */
628
175708
                            if (pixel != 0xff)
629
                            {
630
174268
                                pixel |= (GX_UBYTE)(pixel << 4);
631
174268
                                *put &= (GX_UBYTE)(~putmask);
632
174268
                                *put |= (GX_UBYTE)(pixel & putmask);
633
                            }
634
                        }
635
636
247564
                        xval++;
637
247564
                        putmask >>= 4;
638
247564
                        if (putmask == 0)
639
                        {
640
123810
                            putmask = 0xf0;
641
123810
                            put++;
642
                        }
643
                    }
644
                }
645
            }
646
28334
            start_pos += pixelmap -> gx_pixelmap_width;
647
        }
648
    }
649
    else
650
    {
651
1826
        get = (GX_CONST GX_UBYTE *)info -> current_pixel_ptr;
652
1826
        get_count = (GX_CONST GX_UBYTE *)info -> current_aux_ptr;
653
1826
        xval = 0;
654
12122
        while (xval < pixelmap -> gx_pixelmap_width)
655
        {
656
10296
            count = *get_count++;
657
658
10296
            if (count & 0x80)
659
            {
660
6580
                count = (GX_UBYTE)((count & 0x7f) + 1);
661
6580
                get++;
662
            }
663
            else
664
            {
665
3716
                count++;
666
3716
                get += count;
667
            }
668
10296
            xval += count;
669
        }
670
    }
671
672
673
    /* This line is drawn. cache the pointer for next line draw. */
674
15986
    info -> current_pixel_ptr = (GX_UBYTE *)get;
675
15986
    info -> current_aux_ptr = (GX_UBYTE *)get_count;
676
15986
}
677
678
/**************************************************************************/
679
/*                                                                        */
680
/*  FUNCTION                                               RELEASE        */
681
/*                                                                        */
682
/*    _gx_display_driver_4bpp_horizontal_pixelmap_line_draw               */
683
/*                                                        PORTABLE C      */
684
/*                                                           6.1          */
685
/*  AUTHOR                                                                */
686
/*                                                                        */
687
/*    Kenneth Maxwell, Microsoft Corporation                              */
688
/*                                                                        */
689
/*  DESCRIPTION                                                           */
690
/*                                                                        */
691
/*    4bpp screen driver horizontal pixelmap line drawing function that   */
692
/*    handles compressed or uncompress, with or without alpha channel.    */
693
/*                                                                        */
694
/*  INPUT                                                                 */
695
/*                                                                        */
696
/*    context                               Drawing context               */
697
/*    xstart                                x-coord of line left          */
698
/*    xend                                  x-coord of line right         */
699
/*    y                                     y-coord of line top           */
700
/*    info                                  GX_FILL_PIXELMAP_INFO struct  */
701
/*                                                                        */
702
/*  OUTPUT                                                                */
703
/*                                                                        */
704
/*    None                                                                */
705
/*                                                                        */
706
/*  CALLS                                                                 */
707
/*                                                                        */
708
/*     _gx_display_driver_4bpp_horizontal_pixelmap_line_c_t_write         */
709
/*                                          Real display driver horizontal*/
710
/*                                            pixelmap line draw function */
711
/*     _gx_display_driver_4bpp_horizontal_pixelmap_line_t_write           */
712
/*                                          Real display driver horizontal*/
713
/*                                            pixelmap line draw function */
714
/*     _gx_display_driver_4bpp_horizontal_pixelmap_line_compressed_write  */
715
/*                                          Real display driver horizontal*/
716
/*                                            pixelmap line draw function */
717
/*     _gx_display_driver_4bpp_horizontal_pixelmap_line_raw_write         */
718
/*                                          Real display driver horizontal*/
719
/*                                            pixelmap line draw function */
720
/*                                                                        */
721
/*  CALLED BY                                                             */
722
/*                                                                        */
723
/*    GUIX Internal Code                                                  */
724
/*                                                                        */
725
/*  RELEASE HISTORY                                                       */
726
/*                                                                        */
727
/*    DATE              NAME                      DESCRIPTION             */
728
/*                                                                        */
729
/*  05-19-2020     Kenneth Maxwell          Initial Version 6.0           */
730
/*  09-30-2020     Kenneth Maxwell          Modified comment(s),          */
731
/*                                            resulting in version 6.1    */
732
/*                                                                        */
733
/**************************************************************************/
734
68079
VOID _gx_display_driver_4bpp_horizontal_pixelmap_line_draw(GX_DRAW_CONTEXT *context,
735
                                                           INT xstart, INT xend, INT y, GX_FILL_PIXELMAP_INFO *info)
736
{
737
68079
GX_PIXELMAP *pixelmap = info -> pixelmap;
738
739
68079
    if (pixelmap == GX_NULL)
740
    {
741
1
        return;
742
    }
743
744
68078
    if (pixelmap -> gx_pixelmap_flags & GX_PIXELMAP_TRANSPARENT)
745
    {
746
32290
        if (pixelmap -> gx_pixelmap_flags & GX_PIXELMAP_COMPRESSED)
747
        {
748
            /* has both compression and alpha */
749
15986
            _gx_display_driver_4bpp_horizontal_pixelmap_line_compressed_transparent_write(context, xstart, xend, y, info);
750
        }
751
        else
752
        {
753
            /* alpha, no compression */
754
16304
            _gx_display_driver_4bpp_horizontal_pixelmap_line_transparent_write(context, xstart, xend, y, info);
755
        }
756
    }
757
    else
758
    {
759
35788
        if (pixelmap -> gx_pixelmap_flags & GX_PIXELMAP_COMPRESSED)
760
        {
761
            /* compressed with no alpha */
762
18544
            _gx_display_driver_4bpp_horizontal_pixelmap_line_compressed_write(context, xstart, xend, y, info);
763
        }
764
        else
765
        {
766
            /* no compression or alpha */
767
17244
            _gx_display_driver_4bpp_horizontal_pixelmap_line_raw_write(context, xstart, xend, y, info);
768
        }
769
    }
770
771
    /* Current pixelmap has gone over, so the offset pointer should be reset. */
772
68078
    if (info -> current_pixel_ptr >= info -> pixelmap -> gx_pixelmap_data + info -> pixelmap -> gx_pixelmap_data_size)
773
    {
774
274
        info -> current_pixel_ptr = (GX_UBYTE *)info ->  pixelmap -> gx_pixelmap_data;
775
274
        info -> current_aux_ptr = (GX_UBYTE *)info ->  pixelmap -> gx_pixelmap_aux_data;
776
    }
777
}
778