]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/HiiDatabase: Preinit background when render string to screen
authorDandan Bi <dandan.bi@intel.com>
Tue, 31 May 2016 08:44:47 +0000 (16:44 +0800)
committerStar Zeng <star.zeng@intel.com>
Mon, 6 Jun 2016 06:08:31 +0000 (14:08 +0800)
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>
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