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 |
|
|
/* FUNCTION RELEASE */ |
32 |
|
|
/* */ |
33 |
|
|
/* _gx_display_driver_16bpp_vertical_line_draw PORTABLE C */ |
34 |
|
|
/* 6.3.0 */ |
35 |
|
|
/* AUTHOR */ |
36 |
|
|
/* */ |
37 |
|
|
/* Kenneth Maxwell, Microsoft Corporation */ |
38 |
|
|
/* */ |
39 |
|
|
/* DESCRIPTION */ |
40 |
|
|
/* */ |
41 |
|
|
/* Generic vertical line draw function for 16bpp canvas. */ |
42 |
|
|
/* */ |
43 |
|
|
/* INPUT */ |
44 |
|
|
/* */ |
45 |
|
|
/* context Drawing context */ |
46 |
|
|
/* ystart y-coord of top endpoint */ |
47 |
|
|
/* yend y-coord of bottom endpoint */ |
48 |
|
|
/* xpos x-coord of left edge */ |
49 |
|
|
/* width width of the line */ |
50 |
|
|
/* color Color of line to write */ |
51 |
|
|
/* */ |
52 |
|
|
/* OUTPUT */ |
53 |
|
|
/* */ |
54 |
|
|
/* None */ |
55 |
|
|
/* */ |
56 |
|
|
/* CALLS */ |
57 |
|
|
/* */ |
58 |
|
|
/* _gx_display_driver_vertical_line_alpha_draw */ |
59 |
|
|
/* Display driver basic vertical */ |
60 |
|
|
/* line alpha draw function */ |
61 |
|
|
/* */ |
62 |
|
|
/* CALLED BY */ |
63 |
|
|
/* */ |
64 |
|
|
/* GUIX Internal Code */ |
65 |
|
|
/* */ |
66 |
|
|
/**************************************************************************/ |
67 |
|
833038 |
VOID _gx_display_driver_16bpp_vertical_line_draw(GX_DRAW_CONTEXT *context, INT ystart, INT yend, INT xpos, INT width, GX_COLOR color) |
68 |
|
|
{ |
69 |
|
|
INT row; |
70 |
|
|
INT column; |
71 |
|
|
USHORT *put; |
72 |
|
|
USHORT *rowstart; |
73 |
|
833038 |
INT len = yend - ystart + 1; |
74 |
|
|
#if defined GX_BRUSH_ALPHA_SUPPORT |
75 |
|
|
GX_UBYTE alpha; |
76 |
|
|
|
77 |
|
833038 |
alpha = context -> gx_draw_context_brush.gx_brush_alpha; |
78 |
✓✓ |
833038 |
if (alpha == 0) |
79 |
|
|
{ |
80 |
|
|
/* Nothing to drawn. Just return. */ |
81 |
|
236 |
return; |
82 |
|
|
} |
83 |
✓✓ |
832802 |
if (alpha != 0xff) |
84 |
|
|
{ |
85 |
|
57444 |
_gx_display_driver_vertical_line_alpha_draw(context, ystart, yend, xpos, width, color, alpha); |
86 |
|
57444 |
return; |
87 |
|
|
} |
88 |
|
|
#endif |
89 |
|
|
|
90 |
|
|
/* pick up starting address of canvas memory */ |
91 |
|
775358 |
rowstart = (USHORT *)context -> gx_draw_context_memory; |
92 |
|
|
|
93 |
|
775358 |
GX_CALCULATE_PUTROW(rowstart, xpos, ystart, context); |
94 |
|
|
|
95 |
|
|
/* draw line from top to bottom */ |
96 |
✓✓ |
44851719 |
for (row = 0; row < len; row++) |
97 |
|
|
{ |
98 |
|
44076361 |
put = rowstart; |
99 |
|
|
|
100 |
|
|
/* draw line width from left to right */ |
101 |
✓✓ |
91327742 |
for (column = 0; column < width; column++) |
102 |
|
|
{ |
103 |
|
47251381 |
*put++ = (USHORT)color; |
104 |
|
|
} |
105 |
|
|
|
106 |
|
|
/* advance to the next scaneline */ |
107 |
|
44076361 |
rowstart += context -> gx_draw_context_pitch; |
108 |
|
|
} |
109 |
|
|
} |
110 |
|
|
|