MdeModulePkg/HiiDatabase: Preinit background when render string to screen

When render string to screen, for proportional fonts,
the background color may not set to the whole BltBuffer.
And this will cause incorrect display.
Now initialize the background color to fix this issue.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Dandan Bi 2016-05-31 16:44:47 +08:00 committed by Star Zeng
parent 3ab41b7a32
commit 0672c2cdfe
1 changed files with 6 additions and 0 deletions

View File

@ -1613,6 +1613,7 @@ HiiStringToImage (
UINTN StrLength;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *RowBufferPtr;
HII_GLOBAL_FONT_INFO *GlobalFont;
UINT32 PreInitBkgnd;
//
// Check incoming parameters.
@ -2049,6 +2050,11 @@ HiiStringToImage (
goto Exit;
}
//
// Initialize the background color.
//
PreInitBkgnd = Background.Blue | Background.Green << 8 | Background.Red << 16;
SetMem32 (BltBuffer,RowInfo[RowIndex].LineWidth * RowInfo[RowIndex].LineHeight * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL),PreInitBkgnd);
//
// Set BufferPtr to Origin by adding baseline to the starting position.
//
BufferPtr = BltBuffer + BaseLine * RowInfo[RowIndex].LineWidth;