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 |
|
|
#define GX_SOURCE_CODE |
22 |
|
|
|
23 |
|
|
|
24 |
|
|
/* Include necessary system files. */ |
25 |
|
|
|
26 |
|
|
#include "gx_api.h" |
27 |
|
|
#include "gx_display.h" |
28 |
|
|
|
29 |
|
|
|
30 |
|
|
/**************************************************************************/ |
31 |
|
|
/* */ |
32 |
|
|
/* FUNCTION RELEASE */ |
33 |
|
|
/* */ |
34 |
|
|
/* _gx_display_driver_32bpp_vertical_line_draw PORTABLE C */ |
35 |
|
|
/* 6.1 */ |
36 |
|
|
/* AUTHOR */ |
37 |
|
|
/* */ |
38 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
39 |
|
|
/* */ |
40 |
|
|
/* DESCRIPTION */ |
41 |
|
|
/* */ |
42 |
|
|
/* Generic vertical line draw function for 16bpp canvas. */ |
43 |
|
|
/* */ |
44 |
|
|
/* INPUT */ |
45 |
|
|
/* */ |
46 |
|
|
/* context Drawing context */ |
47 |
|
|
/* ystart y-coord of top endpoint */ |
48 |
|
|
/* yend y-coord of bottom endpoint */ |
49 |
|
|
/* xpos x-coord of left edge */ |
50 |
|
|
/* width width of the line */ |
51 |
|
|
/* color Color of line to write */ |
52 |
|
|
/* */ |
53 |
|
|
/* OUTPUT */ |
54 |
|
|
/* */ |
55 |
|
|
/* None */ |
56 |
|
|
/* */ |
57 |
|
|
/* CALLS */ |
58 |
|
|
/* */ |
59 |
|
|
/* _gx_display_driver_vertical_line_alpha_draw */ |
60 |
|
|
/* Basic display driver vertical */ |
61 |
|
|
/* line alpha draw function */ |
62 |
|
|
/* */ |
63 |
|
|
/* CALLED BY */ |
64 |
|
|
/* */ |
65 |
|
|
/* GUIX Internal Code */ |
66 |
|
|
/* */ |
67 |
|
|
/**************************************************************************/ |
68 |
|
1218347 |
VOID _gx_display_driver_32bpp_vertical_line_draw(GX_DRAW_CONTEXT *context, INT ystart, INT yend, INT xpos, INT width, GX_COLOR color) |
69 |
|
|
{ |
70 |
|
|
INT row; |
71 |
|
|
INT column; |
72 |
|
|
ULONG *put; |
73 |
|
|
ULONG *rowstart; |
74 |
|
1218347 |
INT len = yend - ystart + 1; |
75 |
|
|
#if defined GX_BRUSH_ALPHA_SUPPORT |
76 |
|
|
GX_UBYTE alpha; |
77 |
|
|
|
78 |
|
1218347 |
alpha = context -> gx_draw_context_brush.gx_brush_alpha; |
79 |
✓✓ |
1218347 |
if (alpha == 0) |
80 |
|
|
{ |
81 |
|
|
/* Nothing to drawn. Just return. */ |
82 |
|
428 |
return; |
83 |
|
|
} |
84 |
✓✓ |
1217919 |
if (alpha != 0xff) |
85 |
|
|
{ |
86 |
|
61732 |
_gx_display_driver_vertical_line_alpha_draw(context, ystart, yend, xpos, width, color, alpha); |
87 |
|
61732 |
return; |
88 |
|
|
} |
89 |
|
|
#endif |
90 |
|
|
|
91 |
|
|
/* pick up starting address of canvas memory */ |
92 |
|
1156187 |
rowstart = (ULONG *)context -> gx_draw_context_memory; |
93 |
|
|
|
94 |
|
|
/* calculate start of scanline */ |
95 |
|
1156187 |
rowstart += context -> gx_draw_context_pitch * ystart; |
96 |
|
|
|
97 |
|
|
/* offset into starting pixel */ |
98 |
|
1156187 |
rowstart += xpos; |
99 |
|
|
|
100 |
|
|
/* draw line from top to bottom */ |
101 |
✓✓ |
65683013 |
for (row = 0; row < len; row++) |
102 |
|
|
{ |
103 |
|
64526826 |
put = rowstart; |
104 |
|
|
|
105 |
|
|
/* draw line width from left to right */ |
106 |
✓✓ |
144331109 |
for (column = 0; column < width; column++) |
107 |
|
|
{ |
108 |
|
79804283 |
*put++ = (ULONG)color; |
109 |
|
|
} |
110 |
|
|
|
111 |
|
|
/* advance to the next scaneline */ |
112 |
|
64526826 |
rowstart += context -> gx_draw_context_pitch; |
113 |
|
|
} |
114 |
|
|
} |