20UINTN mPreviousProgress = 100;
25UINTN mProgressBarForegroundColor;
57 UINTN CurrentAttribute;
62 if (Completion > 100) {
63 return EFI_INVALID_PARAMETER;
69 if (Completion == mPreviousProgress) {
76 if (mPreviousProgress == 100) {
83 mProgressBarForegroundColor = EFI_WHITE;
85 mProgressBarForegroundColor = EFI_BLACK;
86 if (Color->Pixel.Blue >= 0x40) {
87 mProgressBarForegroundColor |= EFI_BLUE;
90 if (Color->Pixel.Green >= 0x40) {
91 mProgressBarForegroundColor |= EFI_GREEN;
94 if (Color->Pixel.Red >= 0x40) {
95 mProgressBarForegroundColor |= EFI_RED;
98 if ((Color->Pixel.Blue >= 0xC0) || (Color->Pixel.Green >= 0xC0) || (Color->Pixel.Red >= 0xC0)) {
99 mProgressBarForegroundColor |= EFI_BRIGHT;
102 if (mProgressBarForegroundColor == EFI_BLACK) {
103 mProgressBarForegroundColor = EFI_WHITE;
110 mPreviousProgress = 0;
116 if (Completion < mPreviousProgress) {
117 DEBUG ((DEBUG_WARN,
"WARNING: Completion (%d) should not be lesss than Previous (%d)!!!\n", Completion, mPreviousProgress));
118 return EFI_INVALID_PARAMETER;
129 Print (L
"\rUpdate Progress - %3d%% ", Completion);
136 EFI_TEXT_ATTR (mProgressBarForegroundColor, EFI_BLACK)
142 for (Index = 0; Index < Completion / 2; Index++) {
143 Print (L
"%c", BLOCKELEMENT_FULL_BLOCK);
154 for ( ; Index < 50; Index++) {
155 Print (L
"%c", BLOCKELEMENT_LIGHT_SHADE);
158 mPreviousProgress = Completion;
EFI_STATUS EFIAPI DisplayUpdateProgress(IN UINTN Completion, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION *Color OPTIONAL)
#define DEBUG(Expression)
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)
EFI_SIMPLE_TEXT_OUTPUT_MODE * Mode
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut