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....@intel.com>
Cc: Eric Dong <eric.d...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan...@intel.com>
Reviewed-by: Eric Dong <eric.d...@intel.com>
---
 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 56b30ff..5d31f75 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
@@ -1611,10 +1611,11 @@ HiiStringToImage (
   UINTN                               RowInfoSize;
   BOOLEAN                             LineBreak;
   UINTN                               StrLength;
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL       *RowBufferPtr;
   HII_GLOBAL_FONT_INFO                *GlobalFont;
+  UINT32                              PreInitBkgnd;
 
   //
   // Check incoming parameters.
   //
 
@@ -2047,10 +2048,15 @@ HiiStringToImage (
         if (BltBuffer == NULL) {
           Status = EFI_OUT_OF_RESOURCES;
           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;
       }
       for (Index1 = RowInfo[RowIndex].StartIndex; Index1 <= 
RowInfo[RowIndex].EndIndex; Index1++) {
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to