| 491 | } |
| 492 | |
| 493 | void 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 | |
| 531 | void XImage::Draw(INTN x, INTN y) |
| 532 | { |
no test coverage detected