本文整理汇总了C++中EFI_UGA_DRAW_PROTOCOL::SetMode方法的典型用法代码示例。如果您正苦于以下问题:C++ EFI_UGA_DRAW_PROTOCOL::SetMode方法的具体用法?C++ EFI_UGA_DRAW_PROTOCOL::SetMode怎么用?C++ EFI_UGA_DRAW_PROTOCOL::SetMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EFI_UGA_DRAW_PROTOCOL
的用法示例。
在下文中一共展示了EFI_UGA_DRAW_PROTOCOL::SetMode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawLogo
//
// Construction and Destruction functions
//
EFI_STATUS
VBoxVgaUgaDrawConstructor (
VBOX_VGA_PRIVATE_DATA *Private
)
{
EFI_UGA_DRAW_PROTOCOL *UgaDraw;
//
// Fill in Private->UgaDraw protocol
//
UgaDraw = &Private->UgaDraw;
UgaDraw->GetMode = VBoxVgaUgaDrawGetMode;
UgaDraw->SetMode = VBoxVgaUgaDrawSetMode;
UgaDraw->Blt = VBoxVgaUgaDrawBlt;
//
// Initialize the private data
//
Private->CurrentMode = 0;
Private->HardwareNeedsStarting = TRUE;
Private->LineBuffer = NULL;
//
// Initialize the hardware
//
UgaDraw->SetMode (
UgaDraw,
Private->ModeData[Private->CurrentMode].HorizontalResolution,
Private->ModeData[Private->CurrentMode].VerticalResolution,
Private->ModeData[Private->CurrentMode].ColorDepth,
Private->ModeData[Private->CurrentMode].RefreshRate
);
DrawLogo (
Private,
Private->ModeData[Private->CurrentMode].HorizontalResolution,
Private->ModeData[Private->CurrentMode].VerticalResolution
);
return EFI_SUCCESS;
}
示例2: FreePool
/**
Set the video device into the specified mode and clears the visible portions of
the output display to black.
@param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
@param ModeNumber Abstraction that defines the current video mode.
@retval EFI_SUCCESS The graphics mode specified by ModeNumber was selected.
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
@retval EFI_UNSUPPORTED ModeNumber is not supported by this device.
@retval EFI_OUT_OF_RESOURCES No resource available.
**/
EFI_STATUS
EFIAPI
ConSplitterGraphicsOutputSetMode (
IN EFI_GRAPHICS_OUTPUT_PROTOCOL * This,
IN UINT32 ModeNumber
)
{
EFI_STATUS Status;
TEXT_OUT_SPLITTER_PRIVATE_DATA *Private;
UINTN Index;
EFI_STATUS ReturnStatus;
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Mode;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
UINTN NumberIndex;
UINTN SizeOfInfo;
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
EFI_UGA_DRAW_PROTOCOL *UgaDraw;
if (ModeNumber >= This->Mode->MaxMode) {
return EFI_UNSUPPORTED;
}
Private = GRAPHICS_OUTPUT_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
Mode = &Private->GraphicsOutputModeBuffer[ModeNumber];
ReturnStatus = EFI_SUCCESS;
//
// return the worst status met
//
for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {
GraphicsOutput = Private->TextOutList[Index].GraphicsOutput;
if (GraphicsOutput != NULL) {
//
// Find corresponding ModeNumber of this GraphicsOutput instance
//
for (NumberIndex = 0; NumberIndex < GraphicsOutput->Mode->MaxMode; NumberIndex ++) {
Status = GraphicsOutput->QueryMode (GraphicsOutput, (UINT32) NumberIndex, &SizeOfInfo, &Info);
if (EFI_ERROR (Status)) {
return Status;
}
if ((Info->HorizontalResolution == Mode->HorizontalResolution) && (Info->VerticalResolution == Mode->VerticalResolution)) {
FreePool (Info);
break;
}
FreePool (Info);
}
Status = GraphicsOutput->SetMode (GraphicsOutput, (UINT32) NumberIndex);
if (EFI_ERROR (Status)) {
ReturnStatus = Status;
}
} else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
UgaDraw = Private->TextOutList[Index].UgaDraw;
if (UgaDraw != NULL) {
Status = UgaDraw->SetMode (
UgaDraw,
Mode->HorizontalResolution,
Mode->VerticalResolution,
32,
60
);
if (EFI_ERROR (Status)) {
ReturnStatus = Status;
}
}
}
}
This->Mode->Mode = ModeNumber;
CopyMem (This->Mode->Info, &Private->GraphicsOutputModeBuffer[ModeNumber], This->Mode->SizeOfInfo);
//
// Information is not enough here, so the following items remain unchanged:
// GraphicsOutputMode->Info->Version, GraphicsOutputMode->Info->PixelFormat
// GraphicsOutputMode->SizeOfInfo, GraphicsOutputMode->FrameBufferBase, GraphicsOutputMode->FrameBufferSize
// These items will be initialized/updated when a new GOP device is added into ConsoleSplitter.
//
return ReturnStatus;
}
示例3: SetMode
/**
Set the current video mode information.
@param This The EFI_UGA_DRAW_PROTOCOL instance.
@param HorizontalResolution The size of video screen in pixels in the X dimension.
@param VerticalResolution The size of video screen in pixels in the Y dimension.
@param ColorDepth Number of bits per pixel, currently defined to be 32.
@param RefreshRate The refresh rate of the monitor in Hertz.
@retval EFI_SUCCESS Mode information returned.
@retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
@retval EFI_OUT_OF_RESOURCES Out of resources.
**/
EFI_STATUS
EFIAPI
ConSplitterUgaDrawSetMode (
IN EFI_UGA_DRAW_PROTOCOL *This,
IN UINT32 HorizontalResolution,
IN UINT32 VerticalResolution,
IN UINT32 ColorDepth,
IN UINT32 RefreshRate
)
{
EFI_STATUS Status;
TEXT_OUT_SPLITTER_PRIVATE_DATA *Private;
UINTN Index;
EFI_STATUS ReturnStatus;
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
UINTN NumberIndex;
UINTN SizeOfInfo;
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
EFI_UGA_DRAW_PROTOCOL *UgaDraw;
Private = UGA_DRAW_SPLITTER_PRIVATE_DATA_FROM_THIS (This);
ReturnStatus = EFI_SUCCESS;
//
// Update the Mode data
//
Private->UgaHorizontalResolution = HorizontalResolution;
Private->UgaVerticalResolution = VerticalResolution;
Private->UgaColorDepth = ColorDepth;
Private->UgaRefreshRate = RefreshRate;
//
// return the worst status met
//
for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {
GraphicsOutput = Private->TextOutList[Index].GraphicsOutput;
if (GraphicsOutput != NULL) {
//
// Find corresponding ModeNumber of this GraphicsOutput instance
//
for (NumberIndex = 0; NumberIndex < GraphicsOutput->Mode->MaxMode; NumberIndex ++) {
Status = GraphicsOutput->QueryMode (GraphicsOutput, (UINT32) NumberIndex, &SizeOfInfo, &Info);
if (EFI_ERROR (Status)) {
return Status;
}
if ((Info->HorizontalResolution == HorizontalResolution) && (Info->VerticalResolution == VerticalResolution)) {
FreePool (Info);
break;
}
FreePool (Info);
}
Status = GraphicsOutput->SetMode (GraphicsOutput, (UINT32) NumberIndex);
if (EFI_ERROR (Status)) {
ReturnStatus = Status;
}
} else if (FeaturePcdGet (PcdUgaConsumeSupport)){
UgaDraw = Private->TextOutList[Index].UgaDraw;
if (UgaDraw != NULL) {
Status = UgaDraw->SetMode (
UgaDraw,
HorizontalResolution,
VerticalResolution,
ColorDepth,
RefreshRate
);
if (EFI_ERROR (Status)) {
ReturnStatus = Status;
}
}
}
}
return ReturnStatus;
}