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 |
|
|
|
23 |
|
|
#define GX_SOURCE_CODE |
24 |
|
|
|
25 |
|
|
|
26 |
|
|
/* Include necessary system files. */ |
27 |
|
|
|
28 |
|
|
#include "gx_api.h" |
29 |
|
|
#include "gx_display.h" |
30 |
|
|
|
31 |
|
|
/**************************************************************************/ |
32 |
|
|
/* */ |
33 |
|
|
/* FUNCTION RELEASE */ |
34 |
|
|
/* */ |
35 |
|
|
/* _gx_display_driver_16bpp_horizontal_line_draw PORTABLE C */ |
36 |
|
|
/* 6.3.0 */ |
37 |
|
|
/* AUTHOR */ |
38 |
|
|
/* */ |
39 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
40 |
|
|
/* */ |
41 |
|
|
/* DESCRIPTION */ |
42 |
|
|
/* */ |
43 |
|
|
/* Generic 16bpp horizontal line draw function. */ |
44 |
|
|
/* */ |
45 |
|
|
/* INPUT */ |
46 |
|
|
/* */ |
47 |
|
|
/* context Drawing context */ |
48 |
|
|
/* xstart x-coord of left endpoint */ |
49 |
|
|
/* xend x-coord of right endpoint */ |
50 |
|
|
/* ypos y-coord of line top */ |
51 |
|
|
/* width Width (height) of the line */ |
52 |
|
|
/* color Color of line to write */ |
53 |
|
|
/* */ |
54 |
|
|
/* OUTPUT */ |
55 |
|
|
/* */ |
56 |
|
|
/* NOne */ |
57 |
|
|
/* */ |
58 |
|
|
/* CALLS */ |
59 |
|
|
/* */ |
60 |
|
|
/* _gx_display_driver_horizontal_line_alpha_draw */ |
61 |
|
|
/* Display driver basic */ |
62 |
|
|
/* horiztonal alpha line draw */ |
63 |
|
|
/* route */ |
64 |
|
|
/* */ |
65 |
|
|
/* CALLED BY */ |
66 |
|
|
/* */ |
67 |
|
|
/* GUIX Internal Code */ |
68 |
|
|
/* */ |
69 |
|
|
/**************************************************************************/ |
70 |
|
1319394 |
VOID _gx_display_driver_16bpp_horizontal_line_draw(GX_DRAW_CONTEXT *context, INT xstart, INT xend, INT ypos, INT width, GX_COLOR color) |
71 |
|
|
{ |
72 |
|
|
INT row; |
73 |
|
|
INT column; |
74 |
|
|
USHORT *put; |
75 |
|
|
USHORT *rowstart; |
76 |
|
1319394 |
INT len = xend - xstart + 1; |
77 |
|
|
|
78 |
|
|
#if defined GX_BRUSH_ALPHA_SUPPORT |
79 |
|
|
GX_UBYTE alpha; |
80 |
|
|
|
81 |
|
1319394 |
alpha = context -> gx_draw_context_brush.gx_brush_alpha; |
82 |
✓✓ |
1319394 |
if (alpha == 0) |
83 |
|
|
{ |
84 |
|
|
/* Nothing to drawn. Just return. */ |
85 |
|
16047 |
return; |
86 |
|
|
} |
87 |
|
|
|
88 |
✓✓ |
1303347 |
if (alpha != 0xff) |
89 |
|
|
{ |
90 |
|
125279 |
_gx_display_driver_horizontal_line_alpha_draw(context, xstart, xend, ypos, width, color, alpha); |
91 |
|
125279 |
return; |
92 |
|
|
} |
93 |
|
|
#endif |
94 |
|
|
|
95 |
|
|
/* pick up start address of canvas memory */ |
96 |
|
1178068 |
rowstart = (USHORT *)context -> gx_draw_context_memory; |
97 |
|
|
|
98 |
|
1178068 |
GX_CALCULATE_PUTROW(rowstart, xstart, ypos, context); |
99 |
|
|
|
100 |
|
|
/* draw 1-pixel hi lines to fill width */ |
101 |
✓✓ |
32071372 |
for (row = 0; row < width; row++) |
102 |
|
|
{ |
103 |
|
30893304 |
put = rowstart; |
104 |
|
|
|
105 |
|
|
/* draw one line, left to right */ |
106 |
✓✓ |
8510851270 |
for (column = 0; column < len; column++) |
107 |
|
|
{ |
108 |
|
8479957966 |
*put++ = (USHORT)color; |
109 |
|
|
} |
110 |
|
30893304 |
rowstart += context -> gx_draw_context_pitch; |
111 |
|
|
} |
112 |
|
|
|
113 |
|
|
} |