From: Ruiyu Ni <ruiyu.ni@intel.com>
To: edk2-devel@lists.01.org
Cc: Liming Gao <liming.gao@intel.com>,
Eric Dong <eric.dong@intel.com>, Dandan Bi <dandan.bi@intel.com>
Subject: [PATCH v2 06/19] MdeModulePkg/HiiDatabase: Refine HiiDrawImage()
Date: Mon, 26 Sep 2016 17:30:22 +0800 [thread overview]
Message-ID: <20160926093035.350612-7-ruiyu.ni@intel.com> (raw)
In-Reply-To: <20160926093035.350612-1-ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
---
MdeModulePkg/Universal/HiiDatabaseDxe/Image.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c
index 2b9c3c3..e5eb677 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Image.c
@@ -1139,7 +1139,6 @@ HiiDrawImage (
EFI_STATUS Status;
HII_DATABASE_PRIVATE_DATA *Private;
BOOLEAN Transparent;
- EFI_IMAGE_INPUT *ImageIn;
EFI_IMAGE_OUTPUT *ImageOut;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer;
UINTN BufferLen;
@@ -1165,7 +1164,6 @@ HiiDrawImage (
}
FontInfo = NULL;
- ImageIn = (EFI_IMAGE_INPUT *) Image;
//
// Check whether the image will be drawn transparently or opaquely.
@@ -1180,7 +1178,7 @@ HiiDrawImage (
// Now EFI_HII_DRAW_FLAG_DEFAULT is set, whether image will be drawn depending
// on the image's transparency setting.
//
- if ((ImageIn->Flags & EFI_IMAGE_TRANSPARENT) == EFI_IMAGE_TRANSPARENT) {
+ if ((Image->Flags & EFI_IMAGE_TRANSPARENT) == EFI_IMAGE_TRANSPARENT) {
Transparent = TRUE;
}
}
@@ -1209,8 +1207,8 @@ HiiDrawImage (
// Clip the image by (Width, Height)
//
- Width = ImageIn->Width;
- Height = ImageIn->Height;
+ Width = Image->Width;
+ Height = Image->Height;
if (Width > (*Blt)->Width - BltX) {
Width = (*Blt)->Width - BltX;
@@ -1225,14 +1223,14 @@ HiiDrawImage (
return EFI_OUT_OF_RESOURCES;
}
- if (Width == ImageIn->Width && Height == ImageIn->Height) {
- CopyMem (BltBuffer, ImageIn->Bitmap, BufferLen);
+ if (Width == Image->Width && Height == Image->Height) {
+ CopyMem (BltBuffer, Image->Bitmap, BufferLen);
} else {
for (Ypos = 0; Ypos < Height; Ypos++) {
- OffsetY1 = ImageIn->Width * Ypos;
+ OffsetY1 = Image->Width * Ypos;
OffsetY2 = Width * Ypos;
for (Xpos = 0; Xpos < Width; Xpos++) {
- BltBuffer[OffsetY2 + Xpos] = ImageIn->Bitmap[OffsetY1 + Xpos];
+ BltBuffer[OffsetY2 + Xpos] = Image->Bitmap[OffsetY1 + Xpos];
}
}
}
@@ -1283,8 +1281,8 @@ HiiDrawImage (
//
// Allocate a new bitmap to hold the incoming image.
//
- Width = ImageIn->Width + BltX;
- Height = ImageIn->Height + BltY;
+ Width = Image->Width + BltX;
+ Height = Image->Height + BltY;
BufferLen = Width * Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
BltBuffer = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) AllocateZeroPool (BufferLen);
@@ -1322,11 +1320,11 @@ HiiDrawImage (
//
*Blt = ImageOut;
return ImageToBlt (
- ImageIn->Bitmap,
+ Image->Bitmap,
BltX,
BltY,
- ImageIn->Width,
- ImageIn->Height,
+ Image->Width,
+ Image->Height,
Transparent,
Blt
);
--
2.9.0.windows.1
next prev parent reply other threads:[~2016-09-26 9:30 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-26 9:30 [PATCH v2 00/19] Add HiiImageEx implementations Ruiyu Ni
2016-09-26 9:30 ` [PATCH v2 01/19] MdeModulePkg/HiiDatabase: Refine GetImageIdOrAddress Ruiyu Ni
2016-09-26 9:30 ` [PATCH v2 02/19] MdeModulePkg/HiiDatabase: Move common code to LocatePackageList() Ruiyu Ni
2016-09-26 9:30 ` [PATCH v2 03/19] MdeModulePkg/HiiDatabase: Refine HiiNewImage() Ruiyu Ni
2016-09-26 9:30 ` [PATCH v2 04/19] MdeModulePkg/HiiDatabase: Refine HiiGetImage() Ruiyu Ni
2016-09-26 9:30 ` [PATCH v2 05/19] MdeModulePkg/HiiDatabase: Refine HiiSetImage() Ruiyu Ni
2016-09-26 9:30 ` Ruiyu Ni [this message]
2016-09-26 9:30 ` [PATCH v2 07/19] MdemodulePkg/HiiDatabase: Correct typo in comments Ruiyu Ni
2016-09-26 9:30 ` [PATCH v2 08/19] MdePkg/HiiImage.h: Include GraphicsOutput.h Ruiyu Ni
2016-09-26 9:30 ` [PATCH v2 09/19] MdeModulePkg/HiiDatabase: Update HiiImage to support PNG/JPEG Ruiyu Ni
2016-09-26 9:30 ` [PATCH v2 10/19] MdePkg/HiiImageDecoder.h: Add HiiImageDecoder protocol header file Ruiyu Ni
2016-09-26 9:30 ` [PATCH v2 11/19] MdeModulePkg/HiiDatabase: Add HiiImageEx implementation Ruiyu Ni
2016-09-26 9:30 ` [PATCH v2 12/19] Nt32Pkg/PlatformBds: Do not call BootLogoEnableLogo Ruiyu Ni
2016-09-26 9:30 ` [PATCH v2 13/19] ArmVirtPkg/PlatformBds: " Ruiyu Ni
2016-09-26 10:06 ` Laszlo Ersek
2016-09-26 12:56 ` Ard Biesheuvel
2016-09-26 9:30 ` [PATCH v2 14/19] OvmfPkg/PlatformBds: " Ruiyu Ni
2016-09-26 10:06 ` Laszlo Ersek
2016-09-26 9:30 ` [PATCH v2 15/19] MdeModulePkg/BootLogoLib&PlatformLogo: Use HII data types in parameters Ruiyu Ni
2016-09-26 9:30 ` [PATCH v2 16/19] MdeModulePkg/Logo: Add LogoDxe module Ruiyu Ni
2016-09-26 9:30 ` [PATCH v2 17/19] Nt32Pkg: Use the new LogoDxe driver Ruiyu Ni
2016-09-26 9:30 ` [PATCH v2 18/19] ArmVirtPkg: " Ruiyu Ni
2016-09-26 10:06 ` Laszlo Ersek
2016-09-26 12:56 ` Ard Biesheuvel
2016-09-26 9:30 ` [PATCH v2 19/19] OvmfPkg: " Ruiyu Ni
2016-09-26 10:06 ` Laszlo Ersek
2016-09-28 8:12 ` [PATCH v2 00/19] Add HiiImageEx implementations Gao, Liming
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160926093035.350612-7-ruiyu.ni@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox