diff options
author | HyperNiki <102851041+HyperNiki@users.noreply.github.com> | 2022-04-09 17:16:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-09 14:16:59 +0000 |
commit | ef12c6a5c077155ecc152c3cefbb60cd928a6acc (patch) | |
tree | c93e1ff7d0772a312a7722ef702abbd46d0d5b97 /UefiMonitorTest | |
parent | 1c3286592b355dadba76c3410b2c5c0d3d7f539d (diff) | |
download | umt-ef12c6a5c077155ecc152c3cefbb60cd928a6acc.tar.gz umt-ef12c6a5c077155ecc152c3cefbb60cd928a6acc.tar.bz2 umt-ef12c6a5c077155ecc152c3cefbb60cd928a6acc.zip |
main: add the rect drawing routine
Diffstat (limited to 'UefiMonitorTest')
-rw-r--r-- | UefiMonitorTest/UefiMonitorTest.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/UefiMonitorTest/UefiMonitorTest.c b/UefiMonitorTest/UefiMonitorTest.c index 56dbd80..3eb7323 100644 --- a/UefiMonitorTest/UefiMonitorTest.c +++ b/UefiMonitorTest/UefiMonitorTest.c @@ -273,6 +273,39 @@ DrawLine ( } STATIC +VOID +PutRect ( + IN GRAPHICS_CONTEXT *Graphics, + IN UINTN X0, + IN UINTN Y0, + IN UINTN X1, + IN UINTN Y1, + GRAPHICS_PIXEL_COLOR *Color + ) +{ + UINT32 *Buffer; + UINT32 Ucolor; + UINT32 Icolor; + UINT32 I, J; + + ASSERT (X0 >= 0 && X0 <= Graphics->Width); + ASSERT (Y0 >= 0 && Y0 <= Graphics->Height); + ASSERT (X1 >= 0 && X1 <= Graphics->Width && X1 >= X0); + ASSERT (Y1 >= 0 && Y1 <= Graphics->Height && Y1 >= Y0); + + Buffer = Graphics->BackBuffer + Y0 * Graphics->Pitch; + Ucolor = *(UINT32 *)Color; + Icolor = GET_ICOLOR(Graphics, Ucolor); + + for (J = Y0; J < Y1; J++) { + for (I = X0; I < X1; I++) { + Buffer[I] = Icolor; + } + Buffer += Graphics->Pitch; + } +} + +STATIC EFI_STATUS Run ( IN GRAPHICS_CONTEXT *Graphics |