aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2022-04-28 00:46:59 +0300
committerJoursoir <chat@joursoir.net>2022-04-28 00:47:31 +0300
commit799b75d1a6ef41d96b4bee2b92733e0ad1e6f462 (patch)
tree823135409814a99f317a828e1694e2e73e4c7800
parentdf423fd45d6c46a227b018c58e9e5b8b237078f5 (diff)
downloadumt-799b75d1a6ef41d96b4bee2b92733e0ad1e6f462.tar.gz
umt-799b75d1a6ef41d96b4bee2b92733e0ad1e6f462.tar.bz2
umt-799b75d1a6ef41d96b4bee2b92733e0ad1e6f462.zip
graphics: add the bordered rectangle drawing routine
-rw-r--r--UefiMonitorTest/Graphics.c23
-rw-r--r--UefiMonitorTest/Graphics.h12
2 files changed, 35 insertions, 0 deletions
diff --git a/UefiMonitorTest/Graphics.c b/UefiMonitorTest/Graphics.c
index 0570dd8..fc9571c 100644
--- a/UefiMonitorTest/Graphics.c
+++ b/UefiMonitorTest/Graphics.c
@@ -336,6 +336,29 @@ PutRect (
}
VOID
+DrawRectWithBorder (
+ IN GRAPHICS_CONTEXT *Graphics,
+ IN UINTN X0,
+ IN UINTN Y0,
+ IN UINTN X1,
+ IN UINTN Y1,
+ IN UINTN BorderSize,
+ IN CONST GRAPHICS_PIXEL_COLOR *MainColor,
+ IN CONST GRAPHICS_PIXEL_COLOR *BorderColor
+ )
+{
+ UINT8 Index;
+
+ for (Index = 0; Index < BorderSize; Index++) {
+ DrawLine (Graphics, X0 , Y0 + Index , X1 - 1 , Y0 + Index , BorderColor);
+ DrawLine (Graphics, X0 + Index , Y0 , X0 + Index , Y1 - 1 , BorderColor);
+ DrawLine (Graphics, X1 - 1 - Index, Y0 , X1 - 1 - Index, Y1 - 1 , BorderColor);
+ DrawLine (Graphics, X0 , Y1 - 1 - Index, X1 - 1 , Y1 - 1 - Index, BorderColor);
+ }
+ PutRect (Graphics, X0 + BorderSize, Y0 + BorderSize, X1 - BorderSize, Y1 - BorderSize, MainColor);
+}
+
+VOID
DrawCircle (
IN GRAPHICS_CONTEXT *Graphics,
IN UINTN X0,
diff --git a/UefiMonitorTest/Graphics.h b/UefiMonitorTest/Graphics.h
index 503a222..6396098 100644
--- a/UefiMonitorTest/Graphics.h
+++ b/UefiMonitorTest/Graphics.h
@@ -138,6 +138,18 @@ PutRect (
);
VOID
+DrawRectWithBorder (
+ IN GRAPHICS_CONTEXT *Graphics,
+ IN UINTN X0,
+ IN UINTN Y0,
+ IN UINTN X1,
+ IN UINTN Y1,
+ IN UINTN BorderSize,
+ IN CONST GRAPHICS_PIXEL_COLOR *MainColor,
+ IN CONST GRAPHICS_PIXEL_COLOR *BorderColor
+ );
+
+VOID
DrawCircle (
IN GRAPHICS_CONTEXT *Graphics,
IN UINTN X0,