]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
MdeModulePkg/HiiDatabase: Preinit background when render string to screen
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / Font.c
index 56b30ff6ffe3416c74fc02c2919162be649d8146..5d31f7513fc95ec0031636457925096c49f4a7ea 100644 (file)
@@ -1613,6 +1613,7 @@ HiiStringToImage (
   UINTN                               StrLength;\r
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL       *RowBufferPtr;\r
   HII_GLOBAL_FONT_INFO                *GlobalFont;\r
+  UINT32                              PreInitBkgnd;\r
 \r
   //\r
   // Check incoming parameters.\r
@@ -2049,6 +2050,11 @@ HiiStringToImage (
           goto Exit;\r
         }\r
         //\r
+        // Initialize the background color.\r
+        //\r
+        PreInitBkgnd = Background.Blue | Background.Green << 8 | Background.Red << 16;\r
+        SetMem32 (BltBuffer,RowInfo[RowIndex].LineWidth * RowInfo[RowIndex].LineHeight * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL),PreInitBkgnd);\r
+        //\r
         // Set BufferPtr to Origin by adding baseline to the starting position.\r
         //\r
         BufferPtr = BltBuffer + BaseLine * RowInfo[RowIndex].LineWidth;\r