Clean UGA from Nt32Pkg.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4161 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2007-10-18 06:01:39 +00:00
parent f083a41cf2
commit 454e9f6593
3 changed files with 23 additions and 81 deletions

View File

@ -33,7 +33,6 @@ Revision History
#include <Protocol/Bds.h> #include <Protocol/Bds.h>
#include <Protocol/DataHub.h> #include <Protocol/DataHub.h>
#include <Protocol/FormBrowserFramework.h> #include <Protocol/FormBrowserFramework.h>
#include <Protocol/UgaDraw.h>
#include <Protocol/BlockIo.h> #include <Protocol/BlockIo.h>
#include <Protocol/ConsoleControl.h> #include <Protocol/ConsoleControl.h>
#include <Protocol/GenericMemoryTest.h> #include <Protocol/GenericMemoryTest.h>

View File

@ -55,59 +55,33 @@ Returns:
--*/ --*/
{ {
EFI_STATUS Status; EFI_STATUS Status;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
EFI_UGA_DRAW_PROTOCOL *UgaDraw; UINT32 SizeOfX;
UINT32 SizeOfX; UINT32 SizeOfY;
UINT32 SizeOfY;
UINT32 ColorDepth;
UINT32 RefreshRate;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color; EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color;
UINTN BlockHeight; UINTN BlockHeight;
UINTN BlockWidth; UINTN BlockWidth;
UINTN BlockNum; UINTN BlockNum;
UINTN PosX; UINTN PosX;
UINTN PosY; UINTN PosY;
UINTN Index; UINTN Index;
if (Progress > 100) { if (Progress > 100) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
UgaDraw = NULL;
Status = gBS->HandleProtocol ( Status = gBS->HandleProtocol (
gST->ConsoleOutHandle, gST->ConsoleOutHandle,
&gEfiGraphicsOutputProtocolGuid, &gEfiGraphicsOutputProtocolGuid,
&GraphicsOutput &GraphicsOutput
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
GraphicsOutput = NULL; return EFI_UNSUPPORTED;
Status = gBS->HandleProtocol (
gST->ConsoleOutHandle,
&gEfiUgaDrawProtocolGuid,
&UgaDraw
);
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
}
} }
if (GraphicsOutput != NULL) { SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution; SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
} else {
Status = UgaDraw->GetMode (
UgaDraw,
&SizeOfX,
&SizeOfY,
&ColorDepth,
&RefreshRate
);
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
}
}
BlockWidth = SizeOfX / 100; BlockWidth = SizeOfX / 100;
BlockHeight = SizeOfY / 50; BlockHeight = SizeOfY / 50;
@ -123,8 +97,7 @@ Returns:
// //
SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0); SetMem (&Color, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL), 0x0);
if (GraphicsOutput != NULL) { Status = GraphicsOutput->Blt (
Status = GraphicsOutput->Blt (
GraphicsOutput, GraphicsOutput,
&Color, &Color,
EfiBltVideoFill, EfiBltVideoFill,
@ -136,28 +109,13 @@ Returns:
SizeOfY - (PosY - GLYPH_HEIGHT - 1), SizeOfY - (PosY - GLYPH_HEIGHT - 1),
SizeOfX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) SizeOfX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
); );
} else {
Status = UgaDraw->Blt (
UgaDraw,
(EFI_UGA_PIXEL *) &Color,
EfiUgaVideoFill,
0,
0,
0,
PosY - GLYPH_HEIGHT - 1,
SizeOfX,
SizeOfY - (PosY - GLYPH_HEIGHT - 1),
SizeOfX * sizeof (EFI_UGA_PIXEL)
);
}
} }
// //
// Show progress by drawing blocks // Show progress by drawing blocks
// //
for (Index = PreviousValue; Index < BlockNum; Index++) { for (Index = PreviousValue; Index < BlockNum; Index++) {
PosX = Index * BlockWidth; PosX = Index * BlockWidth;
if (GraphicsOutput != NULL) { Status = GraphicsOutput->Blt (
Status = GraphicsOutput->Blt (
GraphicsOutput, GraphicsOutput,
&ProgressColor, &ProgressColor,
EfiBltVideoFill, EfiBltVideoFill,
@ -169,20 +127,6 @@ Returns:
BlockHeight, BlockHeight,
(BlockWidth) * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) (BlockWidth) * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
); );
} else {
Status = UgaDraw->Blt (
UgaDraw,
(EFI_UGA_PIXEL *) &ProgressColor,
EfiUgaVideoFill,
0,
0,
PosX,
PosY,
BlockWidth - 1,
BlockHeight,
(BlockWidth) * sizeof (EFI_UGA_PIXEL)
);
}
} }
PrintXY ( PrintXY (

View File

@ -124,7 +124,6 @@
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiSimpleFileSystemProtocolGuid # PROTOCOL SOMETIMES_CONSUMED gEfiSimpleFileSystemProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
gEfiLoadFileProtocolGuid # PROTOCOL SOMETIMES_CONSUMED gEfiLoadFileProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
gEfiUgaDrawProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
gEfiCpuIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiCpuIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiConsoleControlProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiConsoleControlProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiFormBrowserProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiFormBrowserProtocolGuid # PROTOCOL ALWAYS_CONSUMED