add PCD PcdUgaConsumeSupport to switch on/off EFI UGA Draw Protocol's consuming, it could save size by changing PCD's value to FALSE.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4911 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
# N/A
|
||||
# Copyright (c) 2008, Intel Corporation
|
||||
#
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
# are licensed and made available under the terms and conditions of the BSD License
|
||||
# which accompanies this distribution. The full text of the license may be found at
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
#
|
||||
@@ -117,7 +117,7 @@
|
||||
gEfiMemorySubClassGuid
|
||||
gEfiProcessorSubClassGuid
|
||||
gEfiCapsuleVendorGuid
|
||||
|
||||
|
||||
[Protocols]
|
||||
gEfiHiiStringProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiSimpleFileSystemProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
@@ -139,10 +139,11 @@
|
||||
gEfiSerialIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiAcpiS3SaveProtocolGuid
|
||||
|
||||
|
||||
[FeaturePcd.common]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangDepricate
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportHardwareErrorRecord
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdUgaConsumeSupport
|
||||
|
||||
[Pcd.common]
|
||||
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes
|
||||
|
@@ -79,7 +79,7 @@ Returns:
|
||||
&gEfiGraphicsOutputProtocolGuid,
|
||||
(VOID **) &GraphicsOutput
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
GraphicsOutput = NULL;
|
||||
|
||||
Status = gBS->HandleProtocol (
|
||||
@@ -87,15 +87,17 @@ Returns:
|
||||
&gEfiUgaDrawProtocolGuid,
|
||||
(VOID **) &UgaDraw
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
SizeOfX = 0;
|
||||
SizeOfY = 0;
|
||||
if (GraphicsOutput != NULL) {
|
||||
SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;
|
||||
SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
Status = UgaDraw->GetMode (
|
||||
UgaDraw,
|
||||
&SizeOfX,
|
||||
@@ -106,6 +108,8 @@ Returns:
|
||||
if (EFI_ERROR (Status)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
} else {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
BlockWidth = SizeOfX / 100;
|
||||
@@ -135,7 +139,7 @@ Returns:
|
||||
SizeOfY - (PosY - GLYPH_HEIGHT - 1),
|
||||
SizeOfX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
|
||||
);
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
Status = UgaDraw->Blt (
|
||||
UgaDraw,
|
||||
(EFI_UGA_PIXEL *) &Color,
|
||||
@@ -168,7 +172,7 @@ Returns:
|
||||
BlockHeight,
|
||||
(BlockWidth) * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
|
||||
);
|
||||
} else {
|
||||
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
|
||||
Status = UgaDraw->Blt (
|
||||
UgaDraw,
|
||||
(EFI_UGA_PIXEL *) &ProgressColor,
|
||||
|
Reference in New Issue
Block a user