OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcBlitLib.c
Go to the documentation of this file.
1
10#include <Uefi/UefiBaseType.h>
11#include <Protocol/GraphicsOutput.h>
12
13#include <Library/BaseLib.h>
14#include <Library/BaseMemoryLib.h>
15#include <Library/DebugLib.h>
16#include <Library/OcBlitLib.h>
17
18#include "BlitInternal.h"
19
20STATIC CONST EFI_PIXEL_BITMASK mRgbPixelMasks = {
21 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000
22};
23
24STATIC CONST EFI_PIXEL_BITMASK mBgrPixelMasks = {
25 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000
26};
27
36STATIC
37VOID
39 IN CONST EFI_PIXEL_BITMASK *BitMask,
40 OUT UINT32 *BytesPerPixel,
41 OUT INT8 *PixelShl,
42 OUT INT8 *PixelShr
43 )
44{
45 UINT8 Index;
46 UINT32 *Masks;
47 UINT32 MergedMasks;
48
49 ASSERT (BytesPerPixel != NULL);
50
51 MergedMasks = 0;
52 Masks = (UINT32 *)BitMask;
53 for (Index = 0; Index < 3; Index++) {
54 ASSERT ((MergedMasks & Masks[Index]) == 0);
55
56 PixelShl[Index] = (INT8)HighBitSet32 (Masks[Index]) - 23 + (Index * 8);
57 if (PixelShl[Index] < 0) {
58 PixelShr[Index] = -PixelShl[Index];
59 PixelShl[Index] = 0;
60 } else {
61 PixelShr[Index] = 0;
62 }
63
64 DEBUG ((
65 DEBUG_INFO,
66 "OCBLT: %d: shl:%d shr:%d mask:%x\n",
67 Index,
68 PixelShl[Index],
69 PixelShr[Index],
70 Masks[Index]
71 ));
72
73 MergedMasks = (UINT32)(MergedMasks | Masks[Index]);
74 }
75
76 MergedMasks = (UINT32)(MergedMasks | Masks[3]);
77
78 ASSERT (MergedMasks != 0);
79 *BytesPerPixel = (UINT32)((HighBitSet32 (MergedMasks) + 7) / 8);
80 DEBUG ((DEBUG_INFO, "OCBLT: Bytes per pixel: %d\n", *BytesPerPixel));
81}
82
98STATIC
99EFI_STATUS
101 IN OC_BLIT_CONFIGURE *Configure,
102 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Color,
103 IN UINTN DestinationX,
104 IN UINTN DestinationY,
105 IN UINTN Width,
106 IN UINTN Height
107 )
108{
109 UINTN IndexX;
110 UINTN IndexY;
111 UINTN Tmp;
112 UINT8 *Destination;
113 UINT32 Uint32;
114 UINT64 WideFill;
115 BOOLEAN LineBufferReady;
116 UINTN Offset;
117 UINTN WidthInBytes;
118 UINTN SizeInBytes;
119
120 //
121 // BltBuffer to Video: Source is BltBuffer, destination is Video
122 //
123 if (DestinationY + Height > Configure->RotatedHeight) {
124 DEBUG ((DEBUG_VERBOSE, "OCBLT: Past screen (Y)\n"));
125 return RETURN_INVALID_PARAMETER;
126 }
127
128 if (DestinationX + Width > Configure->RotatedWidth) {
129 DEBUG ((DEBUG_VERBOSE, "OCBLT: Past screen (X)\n"));
130 return RETURN_INVALID_PARAMETER;
131 }
132
133 if ((Width == 0) || (Height == 0)) {
134 DEBUG ((DEBUG_VERBOSE, "OCBLT: Width or Height is 0\n"));
135 return RETURN_INVALID_PARAMETER;
136 }
137
138 if (Configure->Rotation == 90) {
139 //
140 // Perform -90 rotation.
141 //
142 Tmp = Width;
143 Width = Height;
144 Height = Tmp;
145 Tmp = DestinationX;
146 DestinationX = Configure->Width - DestinationY - Width;
147 DestinationY = Tmp;
148 } else if (Configure->Rotation == 180) {
149 //
150 // Perform -180 rotation.
151 //
152 DestinationX = Configure->Width - DestinationX - Width;
153 DestinationY = Configure->Height - DestinationY - Height;
154 } else if (Configure->Rotation == 270) {
155 //
156 // Perform +90 rotation.
157 //
158 Tmp = Width;
159 Width = Height;
160 Height = Tmp;
161
162 Tmp = DestinationX;
163 DestinationX = DestinationY;
164 DestinationY = Configure->Height - Tmp - Height;
165 }
166
167 WidthInBytes = Width * BYTES_PER_PIXEL;
168
169 Uint32 = *(UINT32 *)Color;
170 WideFill =
171 (UINT32)(
172 (((Uint32 << Configure->PixelShl[0]) >> Configure->PixelShr[0]) &
173 Configure->PixelMasks.RedMask) |
174 (((Uint32 << Configure->PixelShl[1]) >> Configure->PixelShr[1]) &
175 Configure->PixelMasks.GreenMask) |
176 (((Uint32 << Configure->PixelShl[2]) >> Configure->PixelShr[2]) &
177 Configure->PixelMasks.BlueMask)
178 );
179 DEBUG ((DEBUG_VERBOSE, "OCBLT: color=0x%x, wide-fill=0x%x\n", Uint32, WideFill));
180
181 //
182 // If the size of the pixel data evenly divides the sizeof
183 // WideFill, then a wide fill operation can be used
184 //
185 for (IndexX = BYTES_PER_PIXEL; IndexX < sizeof (WideFill); IndexX++) {
186 ((UINT8 *)&WideFill)[IndexX] = ((UINT8 *)&WideFill)[IndexX % BYTES_PER_PIXEL];
187 }
188
189 if ((DestinationX == 0) && (Width == Configure->PixelsPerScanLine)) {
190 DEBUG ((DEBUG_VERBOSE, "OCBLT: VideoFill (wide, one-shot)\n"));
191 Offset = DestinationY * Configure->PixelsPerScanLine;
192 Offset = BYTES_PER_PIXEL * Offset;
193 Destination = Configure->FrameBuffer + Offset;
194 SizeInBytes = WidthInBytes * Height;
195 if (SizeInBytes >= 8) {
196 SetMem32 (Destination, SizeInBytes & ~3, (UINT32)WideFill);
197 Destination += SizeInBytes & ~3;
198 SizeInBytes &= 3;
199 }
200
201 if (SizeInBytes > 0) {
202 SetMem (Destination, SizeInBytes, (UINT8)(UINTN)WideFill);
203 }
204 } else {
205 LineBufferReady = FALSE;
206 for (IndexY = DestinationY; IndexY < (Height + DestinationY); IndexY++) {
207 Offset = (IndexY * Configure->PixelsPerScanLine) + DestinationX;
208 Offset = BYTES_PER_PIXEL * Offset;
209 Destination = Configure->FrameBuffer + Offset;
210
211 if (((UINTN)Destination & 7) == 0) {
212 DEBUG ((DEBUG_VERBOSE, "OCBLT: VideoFill (wide)\n"));
213 SizeInBytes = WidthInBytes;
214 if (SizeInBytes >= 8) {
215 SetMem64 (Destination, SizeInBytes & ~7, WideFill);
216 Destination += SizeInBytes & ~7;
217 SizeInBytes &= 7;
218 }
219
220 if (SizeInBytes > 0) {
221 CopyMem (Destination, &WideFill, SizeInBytes);
222 }
223 } else {
224 DEBUG ((DEBUG_VERBOSE, "OCBLT: VideoFill (not wide)\n"));
225 if (!LineBufferReady) {
226 CopyMem (Configure->LineBuffer, &WideFill, BYTES_PER_PIXEL);
227 for (IndexX = 1; IndexX < Width; ) {
228 CopyMem (
229 (Configure->LineBuffer + (IndexX * BYTES_PER_PIXEL)),
230 Configure->LineBuffer,
231 MIN (IndexX, Width - IndexX) * BYTES_PER_PIXEL
232 );
233 IndexX += MIN (IndexX, Width - IndexX);
234 }
235
236 LineBufferReady = TRUE;
237 }
238
239 CopyMem (Destination, Configure->LineBuffer, WidthInBytes);
240 }
241 }
242 }
243
244 return RETURN_SUCCESS;
245}
246
265STATIC
266RETURN_STATUS
268 IN OC_BLIT_CONFIGURE *Configure,
269 OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer,
270 IN UINTN SourceX,
271 IN UINTN SourceY,
272 IN UINTN DestinationX,
273 IN UINTN DestinationY,
274 IN UINTN Width,
275 IN UINTN Height,
276 IN UINTN Delta
277 )
278{
279 //
280 // Video to BltBuffer: Source is Video, destination is BltBuffer
281 //
282 if (SourceY + Height > Configure->RotatedHeight) {
283 return RETURN_INVALID_PARAMETER;
284 }
285
286 if (SourceX + Width > Configure->RotatedWidth) {
287 return RETURN_INVALID_PARAMETER;
288 }
289
290 if ((Width == 0) || (Height == 0)) {
291 return RETURN_INVALID_PARAMETER;
292 }
293
294 //
295 // If Delta is zero, then the entire BltBuffer is being used, so Delta is
296 // the number of bytes in each row of BltBuffer. Since BltBuffer is Width
297 // pixels size, the number of bytes in each row can be computed.
298 //
299 if (Delta == 0) {
300 Delta = Width;
301 } else {
302 Delta /= BYTES_PER_PIXEL;
303 }
304
305 switch (Configure->Rotation) {
306 case 0:
307 return BlitLibVideoToBuffer0 (
308 Configure,
309 BltBuffer,
310 SourceX,
311 SourceY,
312 DestinationX,
313 DestinationY,
314 Width,
315 Height,
316 Delta
317 );
318 case 90:
320 Configure,
321 BltBuffer,
322 SourceX,
323 SourceY,
324 DestinationX,
325 DestinationY,
326 Width,
327 Height,
328 Delta
329 );
330 case 180:
332 Configure,
333 BltBuffer,
334 SourceX,
335 SourceY,
336 DestinationX,
337 DestinationY,
338 Width,
339 Height,
340 Delta
341 );
342 case 270:
344 Configure,
345 BltBuffer,
346 SourceX,
347 SourceY,
348 DestinationX,
349 DestinationY,
350 Width,
351 Height,
352 Delta
353 );
354 default:
355 ASSERT (FALSE);
356 break;
357 }
358
359 return RETURN_SUCCESS;
360}
361
380STATIC
381RETURN_STATUS
383 IN OC_BLIT_CONFIGURE *Configure,
384 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer,
385 IN UINTN SourceX,
386 IN UINTN SourceY,
387 IN UINTN DestinationX,
388 IN UINTN DestinationY,
389 IN UINTN Width,
390 IN UINTN Height,
391 IN UINTN Delta
392 )
393{
394 //
395 // BltBuffer to Video: Source is BltBuffer, destination is Video
396 //
397 if (DestinationY + Height > Configure->RotatedHeight) {
398 return RETURN_INVALID_PARAMETER;
399 }
400
401 if (DestinationX + Width > Configure->RotatedWidth) {
402 return RETURN_INVALID_PARAMETER;
403 }
404
405 if ((Width == 0) || (Height == 0)) {
406 return RETURN_INVALID_PARAMETER;
407 }
408
409 //
410 // If Delta is zero, then the entire BltBuffer is being used, so Delta is
411 // the number of bytes in each row of BltBuffer. Since BltBuffer is Width
412 // pixels size, the number of bytes in each row can be computed.
413 //
414 if (Delta == 0) {
415 Delta = Width;
416 } else {
417 Delta /= BYTES_PER_PIXEL;
418 }
419
420 switch (Configure->Rotation) {
421 case 0:
422 return BlitLibBufferToVideo0 (
423 Configure,
424 BltBuffer,
425 SourceX,
426 SourceY,
427 DestinationX,
428 DestinationY,
429 Width,
430 Height,
431 Delta
432 );
433 case 90:
435 Configure,
436 BltBuffer,
437 SourceX,
438 SourceY,
439 DestinationX,
440 DestinationY,
441 Width,
442 Height,
443 Delta
444 );
445 case 180:
447 Configure,
448 BltBuffer,
449 SourceX,
450 SourceY,
451 DestinationX,
452 DestinationY,
453 Width,
454 Height,
455 Delta
456 );
457 case 270:
459 Configure,
460 BltBuffer,
461 SourceX,
462 SourceY,
463 DestinationX,
464 DestinationY,
465 Width,
466 Height,
467 Delta
468 );
469 default:
470 ASSERT (FALSE);
471 break;
472 }
473
474 return RETURN_SUCCESS;
475}
476
492STATIC
493RETURN_STATUS
495 IN OC_BLIT_CONFIGURE *Configure,
496 IN UINTN SourceX,
497 IN UINTN SourceY,
498 IN UINTN DestinationX,
499 IN UINTN DestinationY,
500 IN UINTN Width,
501 IN UINTN Height
502 )
503{
504 UINT8 *Source;
505 UINT8 *Destination;
506 UINTN Offset;
507 UINTN WidthInBytes;
508 UINTN Tmp;
509 INTN LineStride;
510
511 //
512 // Video to Video: Source is Video, destination is Video
513 //
514 if (SourceY + Height > Configure->RotatedHeight) {
515 return RETURN_INVALID_PARAMETER;
516 }
517
518 if (SourceX + Width > Configure->RotatedWidth) {
519 return RETURN_INVALID_PARAMETER;
520 }
521
522 if (DestinationY + Height > Configure->RotatedHeight) {
523 return RETURN_INVALID_PARAMETER;
524 }
525
526 if (DestinationX + Width > Configure->RotatedWidth) {
527 return RETURN_INVALID_PARAMETER;
528 }
529
530 if ((Width == 0) || (Height == 0)) {
531 return RETURN_INVALID_PARAMETER;
532 }
533
534 if (Configure->Rotation == 90) {
535 //
536 // Perform -90 rotation.
537 //
538 Tmp = Width;
539 Width = Height;
540 Height = Tmp;
541 Tmp = DestinationX;
542 DestinationX = Configure->Width - DestinationY - Width;
543 DestinationY = Tmp;
544 Tmp = SourceX;
545 SourceX = Configure->Width - SourceY - Width;
546 SourceY = Tmp;
547 } else if (Configure->Rotation == 180) {
548 //
549 // Perform -180 rotation.
550 //
551 DestinationX = Configure->Width - DestinationX - Width;
552 DestinationY = Configure->Height - DestinationY - Height;
553 SourceX = Configure->Width - SourceX - Width;
554 SourceY = Configure->Height - SourceY - Height;
555 } else if (Configure->Rotation == 270) {
556 //
557 // Perform +90 rotation.
558 //
559 Tmp = Width;
560 Width = Height;
561 Height = Tmp;
562 Tmp = DestinationX;
563 DestinationX = DestinationY;
564 DestinationY = Configure->Height - Tmp - Height;
565 Tmp = SourceX;
566 SourceX = SourceY;
567 SourceY = Configure->Height - Tmp - Height;
568 }
569
570 WidthInBytes = Width * BYTES_PER_PIXEL;
571
572 Offset = (SourceY * Configure->PixelsPerScanLine) + SourceX;
573 Offset = BYTES_PER_PIXEL * Offset;
574 Source = Configure->FrameBuffer + Offset;
575
576 Offset = (DestinationY * Configure->PixelsPerScanLine) + DestinationX;
577 Offset = BYTES_PER_PIXEL * Offset;
578 Destination = Configure->FrameBuffer + Offset;
579
580 LineStride = BYTES_PER_PIXEL * Configure->PixelsPerScanLine;
581 if (Destination > Source) {
582 //
583 // Copy from last line to avoid source is corrupted by copying
584 //
585 Source += Height * LineStride;
586 Destination += Height * LineStride;
587 LineStride = -LineStride;
588 }
589
590 while (Height-- > 0) {
591 CopyMem (Destination, Source, WidthInBytes);
592
593 Source += LineStride;
594 Destination += LineStride;
595 }
596
597 return RETURN_SUCCESS;
598}
599
600RETURN_STATUS
601EFIAPI
603 IN VOID *FrameBuffer,
604 IN EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *FrameBufferInfo,
605 IN UINT32 Rotation,
606 IN OUT OC_BLIT_CONFIGURE *Configure,
607 IN OUT UINTN *ConfigureSize
608 )
609{
610 CONST EFI_PIXEL_BITMASK *BitMask;
611 UINT32 BytesPerPixel;
612 INT8 PixelShl[4];
613 INT8 PixelShr[4];
614
615 STATIC_ASSERT (sizeof (OC_BLIT_CONFIGURE) % 64 == 0, "Incorrect alignment of OC_BLIT_CONFIGURE");
616
617 if (ConfigureSize == NULL) {
618 return RETURN_INVALID_PARAMETER;
619 }
620
621 switch (FrameBufferInfo->PixelFormat) {
622 case PixelRedGreenBlueReserved8BitPerColor:
623 BitMask = &mRgbPixelMasks;
624 break;
625
626 case PixelBlueGreenRedReserved8BitPerColor:
627 BitMask = &mBgrPixelMasks;
628 break;
629
630 case PixelBitMask:
631 BitMask = &FrameBufferInfo->PixelInformation;
632 break;
633
634 case PixelBltOnly:
635 ASSERT (FrameBufferInfo->PixelFormat != PixelBltOnly);
636 return RETURN_UNSUPPORTED;
637
638 default:
639 ASSERT (FALSE);
640 return RETURN_INVALID_PARAMETER;
641 }
642
643 if (FrameBufferInfo->PixelsPerScanLine < FrameBufferInfo->HorizontalResolution) {
644 return RETURN_UNSUPPORTED;
645 }
646
647 BlitLibConfigurePixelFormat (BitMask, &BytesPerPixel, PixelShl, PixelShr);
648
649 if (BytesPerPixel != sizeof (UINT32)) {
650 return RETURN_UNSUPPORTED;
651 }
652
653 if (*ConfigureSize < sizeof (OC_BLIT_CONFIGURE)
654 + FrameBufferInfo->HorizontalResolution * sizeof (UINT32))
655 {
656 *ConfigureSize = sizeof (OC_BLIT_CONFIGURE)
657 + FrameBufferInfo->HorizontalResolution * sizeof (UINT32);
658 return RETURN_BUFFER_TOO_SMALL;
659 }
660
661 if (Configure == NULL) {
662 return RETURN_INVALID_PARAMETER;
663 }
664
665 CopyMem (&Configure->PixelMasks, BitMask, sizeof (*BitMask));
666 CopyMem (Configure->PixelShl, PixelShl, sizeof (PixelShl));
667 CopyMem (Configure->PixelShr, PixelShr, sizeof (PixelShr));
668 Configure->PixelFormat = FrameBufferInfo->PixelFormat;
669 Configure->FrameBuffer = (UINT8 *)FrameBuffer;
670 Configure->Width = FrameBufferInfo->HorizontalResolution;
671 Configure->Height = FrameBufferInfo->VerticalResolution;
672 Configure->PixelsPerScanLine = FrameBufferInfo->PixelsPerScanLine;
673 Configure->Rotation = Rotation;
674
675 if ((Rotation == 90) || (Rotation == 270)) {
676 Configure->RotatedWidth = FrameBufferInfo->VerticalResolution;
677 Configure->RotatedHeight = FrameBufferInfo->HorizontalResolution;
678 } else {
679 Configure->RotatedWidth = FrameBufferInfo->HorizontalResolution;
680 Configure->RotatedHeight = FrameBufferInfo->VerticalResolution;
681 }
682
683 return RETURN_SUCCESS;
684}
685
686RETURN_STATUS
687EFIAPI
689 IN OC_BLIT_CONFIGURE *Configure,
690 IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL,
691 IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
692 IN UINTN SourceX,
693 IN UINTN SourceY,
694 IN UINTN DestinationX,
695 IN UINTN DestinationY,
696 IN UINTN Width,
697 IN UINTN Height,
698 IN UINTN Delta
699 )
700{
701 ASSERT (Configure != NULL);
702
703 switch (BltOperation) {
704 case EfiBltVideoToBltBuffer:
705 return BlitLibVideoToBuffer (
706 Configure,
707 BltBuffer,
708 SourceX,
709 SourceY,
710 DestinationX,
711 DestinationY,
712 Width,
713 Height,
714 Delta
715 );
716
717 case EfiBltVideoToVideo:
718 return BlitLibVideoToVideo (
719 Configure,
720 SourceX,
721 SourceY,
722 DestinationX,
723 DestinationY,
724 Width,
725 Height
726 );
727
728 case EfiBltVideoFill:
729 return BlitLibVideoFill (
730 Configure,
731 BltBuffer,
732 DestinationX,
733 DestinationY,
734 Width,
735 Height
736 );
737
738 case EfiBltBufferToVideo:
739 return BlitLibBufferToVideo (
740 Configure,
741 BltBuffer,
742 SourceX,
743 SourceY,
744 DestinationX,
745 DestinationY,
746 Width,
747 Height,
748 Delta
749 );
750
751 default:
752 return RETURN_INVALID_PARAMETER;
753 }
754}
RETURN_STATUS BlitLibBufferToVideo180(IN OC_BLIT_CONFIGURE *Configure, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, IN UINTN DeltaPixels)
RETURN_STATUS BlitLibBufferToVideo90(IN OC_BLIT_CONFIGURE *Configure, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, IN UINTN DeltaPixels)
RETURN_STATUS BlitLibBufferToVideo270(IN OC_BLIT_CONFIGURE *Configure, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, IN UINTN DeltaPixels)
RETURN_STATUS BlitLibBufferToVideo0(IN OC_BLIT_CONFIGURE *Configure, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, IN UINTN DeltaPixels)
RETURN_STATUS BlitLibVideoToBuffer90(IN OC_BLIT_CONFIGURE *Configure, OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, IN UINTN DeltaPixels)
RETURN_STATUS BlitLibVideoToBuffer270(IN OC_BLIT_CONFIGURE *Configure, OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, IN UINTN DeltaPixels)
RETURN_STATUS BlitLibVideoToBuffer0(IN OC_BLIT_CONFIGURE *Configure, OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, IN UINTN DeltaPixels)
RETURN_STATUS BlitLibVideoToBuffer180(IN OC_BLIT_CONFIGURE *Configure, OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, IN UINTN DeltaPixels)
STATIC EFI_STATUS BlitLibVideoFill(IN OC_BLIT_CONFIGURE *Configure, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Color, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height)
Definition OcBlitLib.c:100
STATIC VOID BlitLibConfigurePixelFormat(IN CONST EFI_PIXEL_BITMASK *BitMask, OUT UINT32 *BytesPerPixel, OUT INT8 *PixelShl, OUT INT8 *PixelShr)
Definition OcBlitLib.c:38
STATIC RETURN_STATUS BlitLibVideoToVideo(IN OC_BLIT_CONFIGURE *Configure, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height)
Definition OcBlitLib.c:494
STATIC RETURN_STATUS BlitLibVideoToBuffer(IN OC_BLIT_CONFIGURE *Configure, OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, IN UINTN Delta)
Definition OcBlitLib.c:267
RETURN_STATUS EFIAPI OcBlitRender(IN OC_BLIT_CONFIGURE *Configure, IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL, IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, IN UINTN Delta)
Definition OcBlitLib.c:688
STATIC RETURN_STATUS BlitLibBufferToVideo(IN OC_BLIT_CONFIGURE *Configure, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, IN UINTN Delta)
Definition OcBlitLib.c:382
RETURN_STATUS EFIAPI OcBlitConfigure(IN VOID *FrameBuffer, IN EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *FrameBufferInfo, IN UINT32 Rotation, IN OUT OC_BLIT_CONFIGURE *Configure, IN OUT UINTN *ConfigureSize)
Definition OcBlitLib.c:602
STATIC CONST EFI_PIXEL_BITMASK mBgrPixelMasks
Definition OcBlitLib.c:24
STATIC CONST EFI_PIXEL_BITMASK mRgbPixelMasks
Definition OcBlitLib.c:20
STATIC_ASSERT(BYTES_PER_PIXEL==sizeof(UINT32), "Non 4-byte pixels are unsupported!")
#define BYTES_PER_PIXEL
Definition OcBlitLib.h:20
struct OC_BLIT_CONFIGURE OC_BLIT_CONFIGURE
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI SetMem(OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
#define ASSERT(x)
Definition coder.h:55
#define MIN(a, b)
Definition deflate.c:1673