public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
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 06/13] MdeModulePkg/HiiDatabase: Refine HiiDrawImage()
Date: Fri, 23 Sep 2016 16:25:14 +0800	[thread overview]
Message-ID: <20160923082521.99872-7-ruiyu.ni@intel.com> (raw)
In-Reply-To: <20160923082521.99872-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 1562767..8335252 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



  parent reply	other threads:[~2016-09-23  8:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-23  8:25 [PATCH 00/13] Add HiiImageEx implementation and demonstrate in Nt32 Ruiyu Ni
2016-09-23  8:25 ` [PATCH 01/13] MdeModulePkg/HiiDatabase: Refine GetImageIdOrAddress Ruiyu Ni
2016-09-23  8:25 ` [PATCH 02/13] MdeModulePkg/HiiDatabase: Move common code to LocatePackageList() Ruiyu Ni
2016-09-23  8:25 ` [PATCH 03/13] MdeModulePkg/HiiDatabase: Refine HiiNewImage() Ruiyu Ni
2016-09-23  8:25 ` [PATCH 04/13] MdeModulePkg/HiiDatabase: Refine HiiGetImage() Ruiyu Ni
2016-09-23  8:25 ` [PATCH 05/13] MdeModulePkg/HiiDatabase: Refine HiiSetImage() Ruiyu Ni
2016-09-23  8:25 ` Ruiyu Ni [this message]
2016-09-23  8:25 ` [PATCH 07/13] MdemodulePkg/HiiDatabase: Correct typo in comments Ruiyu Ni
2016-09-23  8:25 ` [PATCH 08/13] MdeModulePkg/HiiDatabase: Update HiiImage to support PNG/JPEG Ruiyu Ni
2016-09-23  8:25 ` [PATCH 09/13] MdeModulePkg/HiiDatabase: Add HiiImageEx implementation Ruiyu Ni
2016-09-23  8:25 ` [PATCH 10/13] Nt32Pkg/PlatformBds: Do not call BootLogoEnableLogo Ruiyu Ni
2016-09-23  8:25 ` [PATCH 11/13] MdeModulePkg/BootLogoLib&PlatformLogo: Use HII data types in parameters Ruiyu Ni
2016-09-23  8:25 ` [PATCH 12/13] MdeModulePkg/Logo: Add LogoDxe module Ruiyu Ni
2016-09-23  8:25 ` [PATCH 13/13] Nt32Pkg: Use the new LogoDxe driver Ruiyu Ni
2016-09-26  2:55 ` [PATCH 00/13] Add HiiImageEx implementation and demonstrate in Nt32 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=20160923082521.99872-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