]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Change BootLogoEnableLogo use INTN for minus value
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 18 Nov 2015 05:05:22 +0000 (05:05 +0000)
committerniruiyu <niruiyu@Edk2>
Wed, 18 Nov 2015 05:05:22 +0000 (05:05 +0000)
The parameter name is also changed from Coordinate* to Offset* to
reflect that it's the offset to the location specified by Attribute.
For example, when the Attribute is Center, OffsetX and OffsetY are
used to specify the offset to the Center. OffsetX = 100 means
100 pixels right to the Center.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18867 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Include/Library/BootLogoLib.h
MdeModulePkg/Library/BootLogoLib/BootLogoLib.c

index 363740537107328b3ac096dba3cba0023ccd24e4..b39d61b7c3e5a771d335e6a7ad37f3c361d00359 100644 (file)
@@ -24,8 +24,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
@@ -36,8 +36,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
 \r
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