Skip to content

Commit

Permalink
BootApp: clear prompt before booting apps
Browse files Browse the repository at this point in the history
  • Loading branch information
imbushuo committed Mar 20, 2020
1 parent 0fb1eac commit c25d88e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 8 deletions.
Binary file added Application/BootSplashApp/BootPromptClear.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 26 additions & 8 deletions Application/BootSplashApp/SplashApp.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,22 @@ STATIC EFI_GUID gSplashPromptGuid = {
},
};

STATIC EFI_GUID gSplashPromptClearGuid = {
0x5af45c60,
0xa0cd,
0x4aab,
{
0xb6,
0xf4,
0xb1,
0xc0,
0x7c,
0x34,
0x7a,
0xd8,
},
};

VOID EFIAPI InputPollingCallback(IN EFI_EVENT Event, IN VOID *Context)
{
EFI_STATUS Status;
Expand Down Expand Up @@ -137,20 +153,22 @@ VOID EFIAPI DrawPrompt(BOOLEAN Clear)
unsigned int Height;
UINT32 DecoderError;

Status = GetSectionFromAnyFv(
&gSplashPromptGuid, EFI_SECTION_RAW, 0, &ImageData, &ImageSize);
if (Clear) {
Status = GetSectionFromAnyFv(
&gSplashPromptClearGuid, EFI_SECTION_RAW, 0, &ImageData, &ImageSize);
}
else {
Status = GetSectionFromAnyFv(
&gSplashPromptGuid, EFI_SECTION_RAW, 0, &ImageData, &ImageSize);
}

if (!EFI_ERROR(Status)) {
DecoderError = lodepng_decode32(
&DecodedData, &Width, &Height, (unsigned char *)ImageData,
(size_t)ImageSize);

if (!DecoderError) {
if (Clear) {
ZeroMem(DecodedData, Width * Height * sizeof(unsigned char));
}
else {
ConvertBetweenBGRAandRGBA(DecodedData, Width, Height);
}
ConvertBetweenBGRAandRGBA(DecodedData, Width, Height);

// Just check for safety
if (mGop->Mode->Info->VerticalResolution - Height > 0) {
Expand Down
5 changes: 5 additions & 0 deletions Hapanero.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ READ_LOCK_STATUS = TRUE
SECTION UI = "BootSplashPrompt"
}

FILE FREEFORM = 5af45c60-a0cd-4aab-b6f4-b1c07c347ad8 {
SECTION RAW = Lumia950XLPkg/Application/BootSplashApp/BootPromptClear.png
SECTION UI = "BootSplashPromptClear"
}

[FV.FVMAIN_COMPACT]
FvAlignment = 8
ERASE_POLARITY = 1
Expand Down
5 changes: 5 additions & 0 deletions Lumia950.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ READ_LOCK_STATUS = TRUE
SECTION UI = "BootSplashPrompt"
}

FILE FREEFORM = 5af45c60-a0cd-4aab-b6f4-b1c07c347ad8 {
SECTION RAW = Lumia950XLPkg/Application/BootSplashApp/BootPromptClear.png
SECTION UI = "BootSplashPromptClear"
}

[FV.FVMAIN_COMPACT]
FvAlignment = 8
ERASE_POLARITY = 1
Expand Down
5 changes: 5 additions & 0 deletions Lumia950XL.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ READ_LOCK_STATUS = TRUE
SECTION UI = "BootSplashPrompt"
}

FILE FREEFORM = 5af45c60-a0cd-4aab-b6f4-b1c07c347ad8 {
SECTION RAW = Lumia950XLPkg/Application/BootSplashApp/BootPromptClear.png
SECTION UI = "BootSplashPromptClear"
}

[FV.FVMAIN_COMPACT]
FvAlignment = 8
ERASE_POLARITY = 1
Expand Down

0 comments on commit c25d88e

Please sign in to comment.