Revision: 18886
http://sourceforge.net/p/edk2/code/18886
Author: vanjeff
Date: 2015-11-18 08:56:57 +0000 (Wed, 18 Nov 2015)
Log Message:
-----------
MdeModulePkg: Change BootLogoEnableLogo use INTN for minus value
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.
(Sync patch r18867 from main trunk.)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <[email protected]>
Reviewed-by: Feng Tian <[email protected]>
Revision Links:
--------------
http://sourceforge.net/p/edk2/code/18867
Modified Paths:
--------------
branches/UDK2015/MdeModulePkg/Include/Library/BootLogoLib.h
branches/UDK2015/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
Modified: branches/UDK2015/MdeModulePkg/Include/Library/BootLogoLib.h
===================================================================
--- branches/UDK2015/MdeModulePkg/Include/Library/BootLogoLib.h 2015-11-18
08:56:06 UTC (rev 18885)
+++ branches/UDK2015/MdeModulePkg/Include/Library/BootLogoLib.h 2015-11-18
08:56:57 UTC (rev 18886)
@@ -24,8 +24,8 @@
@param[in] ImageFormat Format of the image file.
@param[in] LogoFile The file name of logo to display.
@param[in] Attribute The display attributes of the image returned.
- @param[in] CoordinateX The X coordinate of the image.
- @param[in] CoordinateY The Y coordinate of the image.
+ @param[in] OffsetX The X offset of the image regarding the Attribute.
+ @param[in] OffsetY The Y offset of the image regarding the Attribute.
@retval EFI_SUCCESS Logo was displayed.
@retval EFI_UNSUPPORTED Logo was not found or cannot be displayed.
@@ -36,8 +36,8 @@
IN IMAGE_FORMAT ImageFormat,
IN EFI_GUID *Logo,
IN EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE Attribute,
- IN UINTN CoordinateX,
- IN UINTN CoordinateY
+ IN INTN OffsetX,
+ IN INTN OffsetY
);
Modified: branches/UDK2015/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
===================================================================
--- branches/UDK2015/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
2015-11-18 08:56:06 UTC (rev 18885)
+++ branches/UDK2015/MdeModulePkg/Library/BootLogoLib/BootLogoLib.c
2015-11-18 08:56:57 UTC (rev 18886)
@@ -35,8 +35,8 @@
@param[in] ImageFormat Format of the image file.
@param[in] LogoFile The file name of logo to display.
@param[in] Attribute The display attributes of the image returned.
- @param[in] CoordinateX The X coordinate of the image.
- @param[in] CoordinateY The Y coordinate of the image.
+ @param[in] OffsetX The X offset of the image regarding the Attribute.
+ @param[in] OffsetY The Y offset of the image regarding the Attribute.
@retval EFI_SUCCESS Logo was displayed.
@retval EFI_UNSUPPORTED Logo was not found or cannot be displayed.
@@ -47,8 +47,8 @@
IN IMAGE_FORMAT ImageFormat,
IN EFI_GUID *Logo,
IN EDKII_PLATFORM_LOGO_DISPLAY_ATTRIBUTE Attribute,
- IN UINTN CoordinateX,
- IN UINTN CoordinateY
+ IN INTN OffsetX,
+ IN INTN OffsetY
)
{
EFI_STATUS Status;
@@ -160,8 +160,8 @@
&ImageData,
&ImageSize,
&Attribute,
- &CoordinateX,
- &CoordinateY
+ &OffsetX,
+ &OffsetY
);
if (EFI_ERROR (Status)) {
break;
@@ -199,55 +199,52 @@
//
switch (Attribute) {
case EdkiiPlatformLogoDisplayAttributeLeftTop:
- DestX = CoordinateX;
- DestY = CoordinateY;
+ DestX = 0;
+ DestY = 0;
break;
-
case EdkiiPlatformLogoDisplayAttributeCenterTop:
DestX = (SizeOfX - Width) / 2;
- DestY = CoordinateY;
+ DestY = 0;
break;
-
case EdkiiPlatformLogoDisplayAttributeRightTop:
- DestX = (SizeOfX - Width - CoordinateX);
- DestY = CoordinateY;;
+ DestX = SizeOfX - Width;
+ DestY = 0;
break;
+ case EdkiiPlatformLogoDisplayAttributeCenterLeft:
+ DestX = 0;
+ DestY = (SizeOfY - Height) / 2;
+ break;
+ case EdkiiPlatformLogoDisplayAttributeCenter:
+ DestX = (SizeOfX - Width) / 2;
+ DestY = (SizeOfY - Height) / 2;
+ break;
case EdkiiPlatformLogoDisplayAttributeCenterRight:
- DestX = (SizeOfX - Width - CoordinateX);
+ DestX = SizeOfX - Width;
DestY = (SizeOfY - Height) / 2;
break;
- case EdkiiPlatformLogoDisplayAttributeRightBottom:
- DestX = (SizeOfX - Width - CoordinateX);
- DestY = (SizeOfY - Height - CoordinateY);
+ case EdkiiPlatformLogoDisplayAttributeLeftBottom:
+ DestX = 0;
+ DestY = SizeOfY - Height;
break;
-
case EdkiiPlatformLogoDisplayAttributeCenterBottom:
DestX = (SizeOfX - Width) / 2;
- DestY = (SizeOfY - Height - CoordinateY);
+ DestY = SizeOfY - Height;
break;
-
- case EdkiiPlatformLogoDisplayAttributeLeftBottom:
- DestX = CoordinateX;
- DestY = (SizeOfY - Height - CoordinateY);
+ case EdkiiPlatformLogoDisplayAttributeRightBottom:
+ DestX = SizeOfX - Width;
+ DestY = SizeOfY - Height;
break;
- case EdkiiPlatformLogoDisplayAttributeCenterLeft:
- DestX = CoordinateX;
- DestY = (SizeOfY - Height) / 2;
- break;
-
- case EdkiiPlatformLogoDisplayAttributeCenter:
- DestX = (SizeOfX - Width) / 2;
- DestY = (SizeOfY - Height) / 2;
- break;
-
default:
ASSERT (FALSE);
break;
}
+ DestX += OffsetX;
+ DestY += OffsetY;
+
if ((DestX >= 0) && (DestY >= 0)) {
if (GraphicsOutput != NULL) {
Status = GraphicsOutput->Blt (
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits