From 0672c2cdfebd35af3e68fe0b54408852bf314759 Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Tue, 31 May 2016 16:44:47 +0800 Subject: [PATCH] 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 Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Eric Dong Reviewed-by: Liming Gao --- MdeModulePkg/Universal/HiiDatabaseDxe/Font.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c index 56b30ff6ff..5d31f7513f 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c @@ -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; -- 2.39.2