From c24fa67677571db6751a22dbc2f5105ebede0651 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Tue, 27 Jun 2023 21:05:56 -0600 Subject: [PATCH] MdeModulePkg: Center logo 38.2% from top of screen Use Microsoft's recommended positioning for the boot logo. > We recommend that the logo is placed with its center at 38.2% from the > screen's top edge. This positioning is based on the golden ratio's > visual aesthetics and matches the Windows 10 design proportions. Ref: https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/boot-screen-components#position-the-logo-during-post Signed-off-by: Tim Crawford --- MdeModulePkg/Include/Protocol/PlatformLogo.h | 3 ++- MdeModulePkg/Library/BootLogoLib/BootLogoLib.c | 6 ++++++ MdeModulePkg/Logo/Logo.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Include/Protocol/PlatformLogo.h b/MdeModulePkg/Include/Protocol/PlatformLogo.h index 08e1dc35a4..1e90749052 100644 --- a/MdeModulePkg/Include/Protocol/PlatformLogo.h +++ b/MdeModulePkg/Include/Protocol/PlatformLogo.h @@ -29,7 +29,8 @@ typedef enum { EdkiiPlatformLogoDisplayAttributeCenterBottom, EdkiiPlatformLogoDisplayAttributeLeftBottom, EdkiiPlatformLogoDisplayAttributeCenterLeft, - EdkiiPlatformLogoDisplayAttributeCenter + EdkiiPlatformLogoDisplayAttributeCenter, + EdkiiPlatformLogoDisplayAttributeMicrosoft, } EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE; /** diff --git a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c index 478ec2d40e..c5003875db 100644 --- a/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c +++ b/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c @@ -196,6 +196,12 @@ BootLogoEnableLogo ( DestY = SizeOfY - Image.Height; break; + case EdkiiPlatformLogoDisplayAttributeMicrosoft: + // Position the logo so that its center is 38.2% from the top. + DestX = (SizeOfX - Image.Width) / 2; + DestY = (SizeOfY * 382) / 1000 - Image.Height / 2; + break; + default: ASSERT (FALSE); continue; diff --git a/MdeModulePkg/Logo/Logo.c b/MdeModulePkg/Logo/Logo.c index 8ab874d2da..5ede2dcb02 100644 --- a/MdeModulePkg/Logo/Logo.c +++ b/MdeModulePkg/Logo/Logo.c @@ -26,7 +26,7 @@ EFI_HII_HANDLE mHiiHandle; LOGO_ENTRY mLogos[] = { { IMAGE_TOKEN (IMG_LOGO), - EdkiiPlatformLogoDisplayAttributeCenter, + EdkiiPlatformLogoDisplayAttributeMicrosoft, 0, 0 }