]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
MdeModulePkg: Change BootLogoEnableLogo use INTN for minus value
[mirror_edk2.git] / MdeModulePkg / Library / BootLogoLib / BootLogoLib.c
index 312adb04db42bd2e361660873d46fa2ef1df702a..f824ae13c28653d095ed5c9d48cc16130eaf9065 100644 (file)
@@ -35,8 +35,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   @param[in]  ImageFormat Format of the image file.\r
   @param[in]  LogoFile    The file name of logo to display.\r
   @param[in]  Attribute   The display attributes of the image returned.\r
-  @param[in]  CoordinateX The X coordinate of the image.\r
-  @param[in]  CoordinateY The Y coordinate of the image.\r
+  @param[in]  OffsetX     The X offset of the image regarding the Attribute.\r
+  @param[in]  OffsetY     The Y offset of the image regarding the Attribute.\r
 \r
   @retval EFI_SUCCESS     Logo was displayed.\r
   @retval EFI_UNSUPPORTED Logo was not found or cannot be displayed.\r
@@ -47,8 +47,8 @@ BootLogoEnableLogo (
   IN  IMAGE_FORMAT                          ImageFormat,\r
   IN  EFI_GUID                              *Logo,\r
   IN  EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE Attribute,\r
-  IN  UINTN                                 CoordinateX,\r
-  IN  UINTN                                 CoordinateY\r
+  IN  INTN                                  OffsetX,\r
+  IN  INTN                                  OffsetY\r
   )\r
 {\r
   EFI_STATUS                    Status;\r
@@ -160,8 +160,8 @@ BootLogoEnableLogo (
                                &ImageData,\r
                                &ImageSize,\r
                                &Attribute,\r
-                               &CoordinateX,\r
-                               &CoordinateY\r
+                               &OffsetX,\r
+                               &OffsetY\r
                                );\r
       if (EFI_ERROR (Status)) {\r
         break;\r
@@ -199,48 +199,42 @@ BootLogoEnableLogo (
     //\r
     switch (Attribute) {\r
     case EdkiiPlatformLogoDisplayAttributeLeftTop:\r
-      DestX = CoordinateX;\r
-      DestY = CoordinateY;\r
+      DestX = 0;\r
+      DestY = 0;\r
       break;\r
-\r
     case EdkiiPlatformLogoDisplayAttributeCenterTop:\r
       DestX = (SizeOfX - Width) / 2;\r
-      DestY = CoordinateY;\r
+      DestY = 0;\r
       break;\r
-\r
     case EdkiiPlatformLogoDisplayAttributeRightTop:\r
-      DestX = (SizeOfX - Width - CoordinateX);\r
-      DestY = CoordinateY;;\r
+      DestX = SizeOfX - Width;\r
+      DestY = 0;\r
       break;\r
 \r
-    case EdkiiPlatformLogoDisplayAttributeCenterRight:\r
-      DestX = (SizeOfX - Width - CoordinateX);\r
+    case EdkiiPlatformLogoDisplayAttributeCenterLeft:\r
+      DestX = 0;\r
       DestY = (SizeOfY - Height) / 2;\r
       break;\r
-\r
-    case EdkiiPlatformLogoDisplayAttributeRightBottom:\r
-      DestX = (SizeOfX - Width - CoordinateX);\r
-      DestY = (SizeOfY - Height - CoordinateY);\r
-      break;\r
-\r
-    case EdkiiPlatformLogoDisplayAttributeCenterBottom:\r
+    case EdkiiPlatformLogoDisplayAttributeCenter:\r
       DestX = (SizeOfX - Width) / 2;\r
-      DestY = (SizeOfY - Height - CoordinateY);\r
-      break;\r
-\r
-    case EdkiiPlatformLogoDisplayAttributeLeftBottom:\r
-      DestX = CoordinateX;\r
-      DestY = (SizeOfY - Height - CoordinateY);\r
+      DestY = (SizeOfY - Height) / 2;\r
       break;\r
-\r
-    case EdkiiPlatformLogoDisplayAttributeCenterLeft:\r
-      DestX = CoordinateX;\r
+    case EdkiiPlatformLogoDisplayAttributeCenterRight:\r
+      DestX = SizeOfX - Width;\r
       DestY = (SizeOfY - Height) / 2;\r
       break;\r
 \r
-    case EdkiiPlatformLogoDisplayAttributeCenter:\r
+    case EdkiiPlatformLogoDisplayAttributeLeftBottom:\r
+      DestX = 0;\r
+      DestY = SizeOfY - Height;\r
+      break;\r
+    case EdkiiPlatformLogoDisplayAttributeCenterBottom:\r
       DestX = (SizeOfX - Width) / 2;\r
-      DestY = (SizeOfY - Height) / 2;\r
+      DestY = SizeOfY - Height;\r
+      break;\r
+    case EdkiiPlatformLogoDisplayAttributeRightBottom:\r
+      DestX = SizeOfX - Width;\r
+      DestY = SizeOfY - Height;\r
       break;\r
 \r
     default:\r
@@ -248,6 +242,9 @@ BootLogoEnableLogo (
       break;\r
     }\r
 \r
+    DestX += OffsetX;\r
+    DestY += OffsetY;\r
+\r
     if ((DestX >= 0) && (DestY >= 0)) {\r
       if (GraphicsOutput != NULL) {\r
         Status = GraphicsOutput->Blt (\r