]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/Image.c
MdeModulePkg/HiiDatabase: Refine HiiDrawImage()
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / Image.c
index 2b9c3c30cd3479286d49ceb4759370bfe73af752..e5eb677dbfe9823f2485e05db8178082ccf89c61 100644 (file)
@@ -1139,7 +1139,6 @@ HiiDrawImage (
   EFI_STATUS                          Status;\r
   HII_DATABASE_PRIVATE_DATA           *Private;\r
   BOOLEAN                             Transparent;\r
-  EFI_IMAGE_INPUT                     *ImageIn;\r
   EFI_IMAGE_OUTPUT                    *ImageOut;\r
   EFI_GRAPHICS_OUTPUT_BLT_PIXEL       *BltBuffer;\r
   UINTN                               BufferLen;\r
@@ -1165,7 +1164,6 @@ HiiDrawImage (
   }\r
 \r
   FontInfo = NULL;\r
-  ImageIn = (EFI_IMAGE_INPUT *) Image;\r
 \r
   //\r
   // Check whether the image will be drawn transparently or opaquely.\r
@@ -1180,7 +1178,7 @@ HiiDrawImage (
     // Now EFI_HII_DRAW_FLAG_DEFAULT is set, whether image will be drawn depending\r
     // on the image's transparency setting.\r
     //\r
-    if ((ImageIn->Flags & EFI_IMAGE_TRANSPARENT) == EFI_IMAGE_TRANSPARENT) {\r
+    if ((Image->Flags & EFI_IMAGE_TRANSPARENT) == EFI_IMAGE_TRANSPARENT) {\r
       Transparent = TRUE;\r
     }\r
   }\r
@@ -1209,8 +1207,8 @@ HiiDrawImage (
     // Clip the image by (Width, Height)\r
     //\r
 \r
-    Width  = ImageIn->Width;\r
-    Height = ImageIn->Height;\r
+    Width  = Image->Width;\r
+    Height = Image->Height;\r
 \r
     if (Width > (*Blt)->Width - BltX) {\r
       Width = (*Blt)->Width - BltX;\r
@@ -1225,14 +1223,14 @@ HiiDrawImage (
       return EFI_OUT_OF_RESOURCES;\r
     }\r
 \r
-    if (Width == ImageIn->Width && Height == ImageIn->Height) {\r
-      CopyMem (BltBuffer, ImageIn->Bitmap, BufferLen);\r
+    if (Width == Image->Width && Height == Image->Height) {\r
+      CopyMem (BltBuffer, Image->Bitmap, BufferLen);\r
     } else {\r
       for (Ypos = 0; Ypos < Height; Ypos++) {\r
-        OffsetY1 = ImageIn->Width * Ypos;\r
+        OffsetY1 = Image->Width * Ypos;\r
         OffsetY2 = Width * Ypos;\r
         for (Xpos = 0; Xpos < Width; Xpos++) {\r
-          BltBuffer[OffsetY2 + Xpos] = ImageIn->Bitmap[OffsetY1 + Xpos];\r
+          BltBuffer[OffsetY2 + Xpos] = Image->Bitmap[OffsetY1 + Xpos];\r
         }\r
       }\r
     }\r
@@ -1283,8 +1281,8 @@ HiiDrawImage (
     //\r
     // Allocate a new bitmap to hold the incoming image.\r
     //\r
-    Width  = ImageIn->Width  + BltX;\r
-    Height = ImageIn->Height + BltY;\r
+    Width  = Image->Width  + BltX;\r
+    Height = Image->Height + BltY;\r
 \r
     BufferLen = Width * Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);\r
     BltBuffer = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) AllocateZeroPool (BufferLen);\r
@@ -1322,11 +1320,11 @@ HiiDrawImage (
     //\r
     *Blt = ImageOut;\r
     return ImageToBlt (\r
-             ImageIn->Bitmap,\r
+             Image->Bitmap,\r
              BltX,\r
              BltY,\r
-             ImageIn->Width,\r
-             ImageIn->Height,\r
+             Image->Width,\r
+             Image->Height,\r
              Transparent,\r
              Blt\r
              );\r