MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / InitBootScreen

Function InitBootScreen

rEFIt_UEFI/entry_scan/bootscreen.cpp:737–802  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

735}
736
737EFI_STATUS InitBootScreen(IN LOADER_ENTRY *Entry)
738{
739 EFI_GRAPHICS_OUTPUT_BLT_PIXEL thePixel = Entry->BootBgColor;
740 XImage logo;
741// INTN screenWidth, screenHeight;
742 UINT8 customBoot = Entry->CustomBoot;
743
744 if (OSFLAG_ISUNSET(Entry->Flags, OSFLAG_USEGRAPHICS)) {
745 DBG("Custom boot screen not used because entry has unset use graphics\n");
746 return EFI_ABORTED;
747 }
748 if (customBoot == CUSTOM_BOOT_USER) {
749 logo = Entry->CustomLogo;
750 } else if (customBoot == CUSTOM_BOOT_DISABLED) {
751 customBoot = gSettings.CustomBoot;
752 if (customBoot == CUSTOM_BOOT_USER) {
753 logo = *gSettings.CustomLogo;
754 }
755 }
756 switch (customBoot) {
757 case CUSTOM_BOOT_NONE:
758 // No logo
759 DBG("Custom boot is using no logo\n");
760 break;
761
762 case CUSTOM_BOOT_APPLE:
763 // Gray on gray apple
764 logo.FromPNG(grayAppleLogo, sizeof(grayAppleLogo));
765 thePixel = grayBackgroundPixel;
766 DBG("Custom boot is using apple logo\n");
767 break;
768
769 case CUSTOM_BOOT_ALT_APPLE:
770 // Alternate white on black apple
771 logo.FromPNG(whiteAppleLogo, sizeof(whiteAppleLogo));
772 thePixel = blackBackgroundPixel;
773 DBG("Custom boot is using alternate logo\n");
774 break;
775
776 case CUSTOM_BOOT_THEME:
777 // TODO: Custom boot theme
778 DBG("Custom boot is using theme logo\n");
779 ThemeX.ClearScreen();
780 return EFI_SUCCESS;
781
782 case CUSTOM_BOOT_USER:
783 // Custom user logo
784 if (!logo.isEmpty()) {
785 thePixel = grayBackgroundPixel;
786 DBG("Custom boot is using custom logo\n");
787 break;
788 }
789
790 default:
791 DBG("Custom boot is disabled\n");
792 return EFI_ABORTED;
793 }
794

Callers 1

StartLoaderMethod · 0.85

Calls 7

egClearScreenFunction · 0.85
FromPNGMethod · 0.80
ClearScreenMethod · 0.80
GetWidthMethod · 0.80
GetHeightMethod · 0.80
isEmptyMethod · 0.45
DrawMethod · 0.45

Tested by

no test coverage detected