MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / DrawWithoutCompose

Method DrawWithoutCompose

rEFIt_UEFI/libeg/XImage.cpp:493–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491}
492
493void XImage::DrawWithoutCompose(INTN x, INTN y, UINTN width, UINTN height)
494{
495 if (isEmpty()) {
496 return;
497 }
498
499 if ( width == 0 ) width = Width;
500 if ( height == 0 ) height = Height;
501 UINTN AreaWidth = (x + width > (UINTN)UGAWidth) ? (x > UGAWidth ? 0 : UGAWidth - x) : width;
502 UINTN AreaHeight = (y + height > (UINTN)UGAHeight) ? (y > UGAHeight ? 0 : UGAHeight - y) : height;
503
504// DBG("area=%d,%d\n", AreaWidth, AreaHeight);
505 // prepare protocols
506 EFI_STATUS Status;
507 EFI_GUID UgaDrawProtocolGuid = EFI_UGA_DRAW_PROTOCOL_GUID;
508 EFI_UGA_DRAW_PROTOCOL *UgaDraw = NULL;
509 EFI_GUID GraphicsOutputProtocolGuid = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
510 EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput = NULL;
511
512 Status = EfiLibLocateProtocol(&GraphicsOutputProtocolGuid, (VOID **)&GraphicsOutput);
513 if (EFI_ERROR(Status)) {
514 GraphicsOutput = NULL;
515 Status = EfiLibLocateProtocol(&UgaDrawProtocolGuid, (VOID **)&UgaDraw);
516 if (EFI_ERROR(Status))
517 UgaDraw = NULL;
518 }
519 //output combined image
520 if (GraphicsOutput != NULL) {
521 GraphicsOutput->Blt(GraphicsOutput, (*this).GetPixelPtr(0, 0),
522 EfiBltBufferToVideo,
523 0, 0, x, y, AreaWidth, AreaHeight, GetWidth()*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
524 }
525 else if (UgaDraw != NULL) {
526 UgaDraw->Blt(UgaDraw, (EFI_UGA_PIXEL *)(*this).GetPixelPtr(0, 0), EfiUgaBltBufferToVideo,
527 0, 0, x, y, AreaWidth, AreaHeight, GetWidth()*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
528 }
529}
530
531void XImage::Draw(INTN x, INTN y)
532{

Callers 8

SwitchToGraphicsAndClearFunction · 0.80
DrawMenuTextMethod · 0.80
DrawMainMenuEntryMethod · 0.80
DrawMethod · 0.80
DrawOnBackMethod · 0.80
ClearScreenMethod · 0.80
FillRectAreaOfScreenMethod · 0.80
HideMethod · 0.80

Calls 3

GetPixelPtrMethod · 0.80
EfiLibLocateProtocolFunction · 0.70
GetWidthFunction · 0.50

Tested by

no test coverage detected