From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5B6441A1E01 for ; Mon, 26 Sep 2016 02:30:48 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP; 26 Sep 2016 02:30:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,398,1470726000"; d="scan'208";a="13208356" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.25]) by fmsmga006.fm.intel.com with ESMTP; 26 Sep 2016 02:30:46 -0700 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Liming Gao , Eric Dong , Dandan Bi Date: Mon, 26 Sep 2016 17:30:22 +0800 Message-Id: <20160926093035.350612-7-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 In-Reply-To: <20160926093035.350612-1-ruiyu.ni@intel.com> References: <20160926093035.350612-1-ruiyu.ni@intel.com> Subject: [PATCH v2 06/19] MdeModulePkg/HiiDatabase: Refine HiiDrawImage() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Sep 2016 09:30:48 -0000 Contributed-under: TianoCore Contribution Agreement 1.0 Cc: Liming Gao Cc: Eric Dong Cc: Dandan Bi Signed-off-by: Ruiyu Ni --- 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