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 |
|
|
|
30 |
|
|
/**************************************************************************/ |
31 |
|
|
/* */ |
32 |
|
|
/* FUNCTION RELEASE */ |
33 |
|
|
/* */ |
34 |
|
|
/* _gx_display_driver_32bpp_horizontal_line_draw PORTABLE C */ |
35 |
|
|
/* 6.1 */ |
36 |
|
|
/* AUTHOR */ |
37 |
|
|
/* */ |
38 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
39 |
|
|
/* */ |
40 |
|
|
/* DESCRIPTION */ |
41 |
|
|
/* */ |
42 |
|
|
/* Generic 32bpp color format horizontal line draw function. */ |
43 |
|
|
/* */ |
44 |
|
|
/* INPUT */ |
45 |
|
|
/* */ |
46 |
|
|
/* context Drawing context */ |
47 |
|
|
/* xstart x-coord of left endpoint */ |
48 |
|
|
/* xend x-coord of right endpoint */ |
49 |
|
|
/* ypos y-coord of line top */ |
50 |
|
|
/* width Width (height) of the line */ |
51 |
|
|
/* color Color of line to write */ |
52 |
|
|
/* */ |
53 |
|
|
/* OUTPUT */ |
54 |
|
|
/* */ |
55 |
|
|
/* NOne */ |
56 |
|
|
/* */ |
57 |
|
|
/* CALLS */ |
58 |
|
|
/* */ |
59 |
|
|
/* _gx_display_driver_horizontal_line_alpha_draw */ |
60 |
|
|
/* Basic horizontal line alpha */ |
61 |
|
|
/* draw function */ |
62 |
|
|
/* */ |
63 |
|
|
/* CALLED BY */ |
64 |
|
|
/* */ |
65 |
|
|
/* GUIX Internal Code */ |
66 |
|
|
/* */ |
67 |
|
|
/**************************************************************************/ |
68 |
|
4234624 |
VOID _gx_display_driver_32bpp_horizontal_line_draw(GX_DRAW_CONTEXT *context, INT xstart, INT xend, INT ypos, INT width, GX_COLOR color) |
69 |
|
|
{ |
70 |
|
|
INT row; |
71 |
|
|
INT column; |
72 |
|
|
ULONG *put; |
73 |
|
|
ULONG *rowstart; |
74 |
|
4234624 |
INT len = xend - xstart + 1; |
75 |
|
|
|
76 |
|
|
#if defined GX_BRUSH_ALPHA_SUPPORT |
77 |
|
|
GX_UBYTE alpha; |
78 |
|
|
|
79 |
|
4234624 |
alpha = context -> gx_draw_context_brush.gx_brush_alpha; |
80 |
✓✓ |
4234624 |
if (alpha == 0) |
81 |
|
|
{ |
82 |
|
|
/* Nothing to drawn. Just return. */ |
83 |
|
101314 |
return; |
84 |
|
|
} |
85 |
|
|
|
86 |
✓✓ |
4133310 |
if (alpha != 0xff) |
87 |
|
|
{ |
88 |
|
196549 |
_gx_display_driver_horizontal_line_alpha_draw(context, xstart, xend, ypos, width, color, alpha); |
89 |
|
196549 |
return; |
90 |
|
|
} |
91 |
|
|
#endif |
92 |
|
|
|
93 |
|
|
/* pick up start address of canvas memory */ |
94 |
|
3936761 |
rowstart = (ULONG *)context -> gx_draw_context_memory; |
95 |
|
|
|
96 |
|
|
/* calculate start of row address */ |
97 |
|
3936761 |
rowstart += context -> gx_draw_context_pitch * ypos; |
98 |
|
|
|
99 |
|
|
/* calculate pixel address */ |
100 |
|
3936761 |
rowstart += xstart; |
101 |
|
|
/* draw 1-pixel hi lines to fill width */ |
102 |
✓✓ |
55386601 |
for (row = 0; row < width; row++) |
103 |
|
|
{ |
104 |
|
51449840 |
put = rowstart; |
105 |
|
|
|
106 |
|
|
/* draw one line, left to right */ |
107 |
✓✓ |
11100173915 |
for (column = 0; column < len; column++) |
108 |
|
|
{ |
109 |
|
11048724075 |
*put++ = (ULONG)color; |
110 |
|
|
} |
111 |
|
51449840 |
rowstart += context -> gx_draw_context_pitch; |
112 |
|
|
} |
113 |
|
|
} |
114 |
|
|
|