git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4161
6f19259b-4bc3-4df7-8a09-
765794883524
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
#include <Protocol/Bds.h>\r
#include <Protocol/DataHub.h>\r
#include <Protocol/FormBrowserFramework.h>\r
#include <Protocol/Bds.h>\r
#include <Protocol/DataHub.h>\r
#include <Protocol/FormBrowserFramework.h>\r
-#include <Protocol/UgaDraw.h>\r
#include <Protocol/BlockIo.h>\r
#include <Protocol/ConsoleControl.h>\r
#include <Protocol/GenericMemoryTest.h>\r
#include <Protocol/BlockIo.h>\r
#include <Protocol/ConsoleControl.h>\r
#include <Protocol/GenericMemoryTest.h>\r
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;\r
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;\r
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;\r
- UINT32 SizeOfX;\r
- UINT32 SizeOfY;\r
- UINT32 ColorDepth;\r
- UINT32 RefreshRate;\r
+ UINT32 SizeOfX;\r
+ UINT32 SizeOfY;\r
EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color;\r
EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color;\r
- UINTN BlockHeight;\r
- UINTN BlockWidth;\r
- UINTN BlockNum;\r
- UINTN PosX;\r
- UINTN PosY;\r
- UINTN Index;\r
+ UINTN BlockHeight;\r
+ UINTN BlockWidth;\r
+ UINTN BlockNum;\r
+ UINTN PosX;\r
+ UINTN PosY;\r
+ UINTN Index;\r
\r
if (Progress > 100) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
\r
if (Progress > 100) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
Status = gBS->HandleProtocol (\r
gST->ConsoleOutHandle,\r
&gEfiGraphicsOutputProtocolGuid,\r
&GraphicsOutput\r
);\r
if (EFI_ERROR (Status)) {\r
Status = gBS->HandleProtocol (\r
gST->ConsoleOutHandle,\r
&gEfiGraphicsOutputProtocolGuid,\r
&GraphicsOutput\r
);\r
if (EFI_ERROR (Status)) {\r
- GraphicsOutput = NULL;\r
-\r
- Status = gBS->HandleProtocol (\r
- gST->ConsoleOutHandle,\r
- &gEfiUgaDrawProtocolGuid,\r
- &UgaDraw\r
- );\r
- if (EFI_ERROR (Status)) {\r
- return EFI_UNSUPPORTED;\r
- }\r
+ return EFI_UNSUPPORTED;\r
- if (GraphicsOutput != NULL) {\r
- SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;\r
- SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;\r
- } else {\r
- Status = UgaDraw->GetMode (\r
- UgaDraw,\r
- &SizeOfX,\r
- &SizeOfY,\r
- &ColorDepth,\r
- &RefreshRate\r
- );\r
- if (EFI_ERROR (Status)) {\r
- return EFI_UNSUPPORTED;\r
- }\r
- }\r
+ SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;\r
+ SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;\r
\r
BlockWidth = SizeOfX / 100;\r
BlockHeight = SizeOfY / 50;\r
\r
BlockWidth = SizeOfX / 100;\r
BlockHeight = SizeOfY / 50;\r
//\r
SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);\r
\r
//\r
SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);\r
\r
- if (GraphicsOutput != NULL) {\r
- Status = GraphicsOutput->Blt (\r
+ Status = GraphicsOutput->Blt (\r
GraphicsOutput,\r
&Color,\r
EfiBltVideoFill,\r
GraphicsOutput,\r
&Color,\r
EfiBltVideoFill,\r
SizeOfY - (PosY - GLYPH_HEIGHT - 1),\r
SizeOfX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
);\r
SizeOfY - (PosY - GLYPH_HEIGHT - 1),\r
SizeOfX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
);\r
- } else {\r
- Status = UgaDraw->Blt (\r
- UgaDraw,\r
- (EFI_UGA_PIXEL *) &Color,\r
- EfiUgaVideoFill,\r
- 0,\r
- 0,\r
- 0,\r
- PosY - GLYPH_HEIGHT - 1,\r
- SizeOfX,\r
- SizeOfY - (PosY - GLYPH_HEIGHT - 1),\r
- SizeOfX * sizeof (EFI_UGA_PIXEL)\r
- );\r
- }\r
}\r
//\r
// Show progress by drawing blocks\r
//\r
for (Index = PreviousValue; Index < BlockNum; Index++) {\r
PosX = Index * BlockWidth;\r
}\r
//\r
// Show progress by drawing blocks\r
//\r
for (Index = PreviousValue; Index < BlockNum; Index++) {\r
PosX = Index * BlockWidth;\r
- if (GraphicsOutput != NULL) {\r
- Status = GraphicsOutput->Blt (\r
+ Status = GraphicsOutput->Blt (\r
GraphicsOutput,\r
&ProgressColor,\r
EfiBltVideoFill,\r
GraphicsOutput,\r
&ProgressColor,\r
EfiBltVideoFill,\r
BlockHeight,\r
(BlockWidth) * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
);\r
BlockHeight,\r
(BlockWidth) * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
);\r
- } else {\r
- Status = UgaDraw->Blt (\r
- UgaDraw,\r
- (EFI_UGA_PIXEL *) &ProgressColor,\r
- EfiUgaVideoFill,\r
- 0,\r
- 0,\r
- PosX,\r
- PosY,\r
- BlockWidth - 1,\r
- BlockHeight,\r
- (BlockWidth) * sizeof (EFI_UGA_PIXEL)\r
- );\r
- }\r
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiSimpleFileSystemProtocolGuid # PROTOCOL SOMETIMES_CONSUMED\r
gEfiLoadFileProtocolGuid # PROTOCOL SOMETIMES_CONSUMED\r
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiSimpleFileSystemProtocolGuid # PROTOCOL SOMETIMES_CONSUMED\r
gEfiLoadFileProtocolGuid # PROTOCOL SOMETIMES_CONSUMED\r
- gEfiUgaDrawProtocolGuid # PROTOCOL SOMETIMES_CONSUMED\r
gEfiCpuIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiConsoleControlProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiFormBrowserProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiCpuIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiConsoleControlProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
gEfiFormBrowserProtocolGuid # PROTOCOL ALWAYS_CONSUMED\r
\r
[depex]\r
gEfiHiiProtocolGuid\r
\r
[depex]\r
gEfiHiiProtocolGuid\r