19 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer,
22 IN UINTN DestinationX,
23 IN UINTN DestinationY,
32 UINT32 *DestinationWalker;
35 UINTN PixelsPerScanLine;
39 PixelsPerScanLine = Configure->PixelsPerScanLine;
41 Destination = (UINT32 *)Configure->FrameBuffer
42 + DestinationY * PixelsPerScanLine + DestinationX;
43 Source = (UINT32 *)BltBuffer
44 + SourceY * DeltaPixels + SourceX;
45 if (Configure->PixelFormat == PixelBlueGreenRedReserved8BitPerColor) {
47 CopyMem (Destination, Source, WidthInBytes);
48 Source += DeltaPixels;
49 Destination += PixelsPerScanLine;
54 DestinationWalker = (UINT32 *)Configure->LineBuffer;
55 SourceWalker = (UINT32 *)Source;
56 for (IndexX = 0; IndexX < Width; IndexX++) {
57 Uint32 = *SourceWalker++;
58 *DestinationWalker++ =
60 (((Uint32 << Configure->PixelShl[0]) >> Configure->PixelShr[0]) &
61 Configure->PixelMasks.RedMask) |
62 (((Uint32 << Configure->PixelShl[1]) >> Configure->PixelShr[1]) &
63 Configure->PixelMasks.GreenMask) |
64 (((Uint32 << Configure->PixelShl[2]) >> Configure->PixelShr[2]) &
65 Configure->PixelMasks.BlueMask)
69 CopyMem (Destination, Configure->LineBuffer, WidthInBytes);
70 Source += DeltaPixels;
71 Destination += PixelsPerScanLine;
82 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer,
85 IN UINTN DestinationX,
86 IN UINTN DestinationY,
95 UINT32 *DestinationWalker;
97 UINTN PixelsPerScanLine;
100 PixelsPerScanLine = Configure->PixelsPerScanLine;
102 Destination = (UINT32 *)Configure->FrameBuffer
103 + (Configure->Width - DestinationY - 1);
104 Source = (UINT32 *)BltBuffer
105 + SourceY * DeltaPixels + SourceX;
107 if (Configure->PixelFormat == PixelBlueGreenRedReserved8BitPerColor) {
108 Uint32 = ((UINT32)SourceX | (UINT32)SourceY
109 | (UINT32)DestinationX | (UINT32)DestinationY
110 | (UINT32)Width | (UINT32)Height
111 | (UINT32)DeltaPixels | (UINT32)PixelsPerScanLine) & (16 - 1);
116 CONST UINTN BlockWidth = 16;
117 Destination += DestinationX * PixelsPerScanLine;
118 for (UINTN Index = 0; Index < Height; Index += BlockWidth) {
119 for (UINTN Index2 = 0; Index2 < Width; Index2 += BlockWidth) {
120 UINT32 *A = Source + Index * DeltaPixels + Index2;
121 UINT32 *B = Destination + Index2 * PixelsPerScanLine - Index;
125 for (UINTN BlockIndex = 0; BlockIndex < BlockWidth; BlockIndex++) {
126 for (UINTN BlockIndex2 = 0; BlockIndex2 < BlockWidth; BlockIndex2++) {
127 B[BlockIndex2 * PixelsPerScanLine - BlockIndex] = A[BlockIndex * DeltaPixels + BlockIndex2];
136 CONST UINTN BlockWidth = 8;
137 Destination += DestinationX * PixelsPerScanLine;
138 for (UINTN Index = 0; Index < Height; Index += BlockWidth) {
139 for (UINTN Index2 = 0; Index2 < Width; Index2 += BlockWidth) {
140 UINT32 *A = Source + Index * DeltaPixels + Index2;
141 UINT32 *B = Destination + Index2 * PixelsPerScanLine - Index;
142 for (UINTN BlockIndex = 0; BlockIndex < BlockWidth; BlockIndex++) {
144 #pragma clang loop unroll(full)
146 for (UINTN BlockIndex2 = 0; BlockIndex2 < BlockWidth; BlockIndex2++) {
147 B[BlockIndex2 * PixelsPerScanLine - BlockIndex] = A[BlockIndex * DeltaPixels + BlockIndex2];
156 CONST UINTN BlockWidth = 4;
157 Destination += DestinationX * PixelsPerScanLine;
158 for (UINTN Index = 0; Index < Height; Index += BlockWidth) {
159 for (UINTN Index2 = 0; Index2 < Width; Index2 += BlockWidth) {
160 UINT32 *A = Source + Index * DeltaPixels + Index2;
161 UINT32 *B = Destination + Index2 * PixelsPerScanLine - Index;
162 for (UINTN BlockIndex = 0; BlockIndex < BlockWidth; BlockIndex++) {
164 #pragma clang loop unroll(full)
166 for (UINTN BlockIndex2 = 0; BlockIndex2 < BlockWidth; BlockIndex2++) {
167 B[BlockIndex2 * PixelsPerScanLine - BlockIndex] = A[BlockIndex * DeltaPixels + BlockIndex2];
176 CONST UINTN BlockWidth = 2;
177 Destination += DestinationX * PixelsPerScanLine;
178 for (UINTN Index = 0; Index < Height; Index += BlockWidth) {
179 for (UINTN Index2 = 0; Index2 < Width; Index2 += BlockWidth) {
180 UINT32 *A = Source + Index * DeltaPixels + Index2;
181 UINT32 *B = Destination + Index2 * PixelsPerScanLine - Index;
182 for (UINTN BlockIndex = 0; BlockIndex < BlockWidth; BlockIndex++) {
184 #pragma clang loop unroll(full)
186 for (UINTN BlockIndex2 = 0; BlockIndex2 < BlockWidth; BlockIndex2++) {
187 B[BlockIndex2 * PixelsPerScanLine - BlockIndex] = A[BlockIndex * DeltaPixels + BlockIndex2];
199 DestinationWalker = Destination;
200 SourceWalker = Source;
201 for (IndexX = DestinationX; IndexX < DestinationX + Width; IndexX++) {
202 DestinationWalker[IndexX * PixelsPerScanLine] = *SourceWalker++;
205 Source += DeltaPixels;
211 DestinationWalker = Destination;
212 SourceWalker = Source;
213 for (IndexX = DestinationX; IndexX < DestinationX + Width; IndexX++) {
214 Uint32 = *SourceWalker++;
215 DestinationWalker[IndexX * PixelsPerScanLine] =
217 (((Uint32 << Configure->PixelShl[0]) >> Configure->PixelShr[0]) &
218 Configure->PixelMasks.RedMask) |
219 (((Uint32 << Configure->PixelShl[1]) >> Configure->PixelShr[1]) &
220 Configure->PixelMasks.GreenMask) |
221 (((Uint32 << Configure->PixelShl[2]) >> Configure->PixelShr[2]) &
222 Configure->PixelMasks.BlueMask)
226 Source += DeltaPixels;
238 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer,
241 IN UINTN DestinationX,
242 IN UINTN DestinationY,
250 UINT32 *SourceWalker;
251 UINT32 *DestinationWalker;
253 UINTN PixelsPerScanLine;
256 PixelsPerScanLine = Configure->PixelsPerScanLine;
258 DestinationX = Configure->Width - DestinationX - Width;
259 DestinationY = Configure->Height - DestinationY - Height;
261 Destination = (UINT32 *)Configure->FrameBuffer
262 + (DestinationY + (Height - 1)) * PixelsPerScanLine + DestinationX;
263 Source = (UINT32 *)BltBuffer
264 + SourceY * DeltaPixels + SourceX;
266 if (Configure->PixelFormat == PixelBlueGreenRedReserved8BitPerColor) {
268 DestinationWalker = Destination;
269 SourceWalker = Source + (Width - 1);
270 for (IndexX = 0; IndexX < Width; IndexX++) {
271 *DestinationWalker++ = *SourceWalker--;
274 Source += DeltaPixels;
275 Destination -= PixelsPerScanLine;
280 DestinationWalker = Destination;
281 SourceWalker = Source + (Width - 1);
282 for (IndexX = 0; IndexX < Width; IndexX++) {
283 Uint32 = *SourceWalker--;
284 *DestinationWalker++ =
286 (((Uint32 << Configure->PixelShl[0]) >> Configure->PixelShr[0]) &
287 Configure->PixelMasks.RedMask) |
288 (((Uint32 << Configure->PixelShl[1]) >> Configure->PixelShr[1]) &
289 Configure->PixelMasks.GreenMask) |
290 (((Uint32 << Configure->PixelShl[2]) >> Configure->PixelShr[2]) &
291 Configure->PixelMasks.BlueMask)
295 Source += DeltaPixels;
296 Destination -= PixelsPerScanLine;
307 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer,
310 IN UINTN DestinationX,
311 IN UINTN DestinationY,
319 UINT32 *SourceWalker;
320 UINT32 *DestinationWalker;
323 UINTN PixelsPerScanLine;
326 PixelsPerScanLine = Configure->PixelsPerScanLine;
328 Destination = (UINT32 *)Configure->FrameBuffer
330 Source = (UINT32 *)BltBuffer
331 + SourceY * DeltaPixels + SourceX;
333 if (Configure->PixelFormat == PixelBlueGreenRedReserved8BitPerColor) {
334 Uint32 = ((UINT32)SourceX | (UINT32)SourceY
335 | (UINT32)DestinationX | (UINT32)DestinationY
336 | (UINT32)Width | (UINT32)Height
337 | (UINT32)DeltaPixels | (UINT32)PixelsPerScanLine) & (16 - 1);
342 CONST UINTN BlockWidth = 16;
343 Destination += (Configure->Height - DestinationX - 1) * PixelsPerScanLine;
344 for (UINTN Index = 0; Index < Height; Index += BlockWidth) {
345 for (UINTN Index2 = 0; Index2 < Width; Index2 += BlockWidth) {
346 UINT32 *A = Source + Index * DeltaPixels + Index2;
347 UINT32 *B = Destination - Index2 * PixelsPerScanLine + Index;
348 for (UINTN BlockIndex = 0; BlockIndex < BlockWidth; BlockIndex++) {
350 #pragma clang loop unroll(full)
352 for (UINTN BlockIndex2 = 0; BlockIndex2 < BlockWidth; BlockIndex2++) {
353 B[BlockIndex - BlockIndex2 * PixelsPerScanLine] = A[BlockIndex * DeltaPixels + BlockIndex2];
362 CONST UINTN BlockWidth = 8;
363 Destination += (Configure->Height - DestinationX - 1) * PixelsPerScanLine;
364 for (UINTN Index = 0; Index < Height; Index += BlockWidth) {
365 for (UINTN Index2 = 0; Index2 < Width; Index2 += BlockWidth) {
366 UINT32 *A = Source + Index * DeltaPixels + Index2;
367 UINT32 *B = Destination - Index2 * PixelsPerScanLine + Index;
368 for (UINTN BlockIndex = 0; BlockIndex < BlockWidth; BlockIndex++) {
370 #pragma clang loop unroll(full)
372 for (UINTN BlockIndex2 = 0; BlockIndex2 < BlockWidth; BlockIndex2++) {
373 B[BlockIndex - BlockIndex2 * PixelsPerScanLine] = A[BlockIndex * DeltaPixels + BlockIndex2];
382 CONST UINTN BlockWidth = 4;
383 Destination += (Configure->Height - DestinationX - 1) * PixelsPerScanLine;
384 for (UINTN Index = 0; Index < Height; Index += BlockWidth) {
385 for (UINTN Index2 = 0; Index2 < Width; Index2 += BlockWidth) {
386 UINT32 *A = Source + Index * DeltaPixels + Index2;
387 UINT32 *B = Destination - Index2 * PixelsPerScanLine + Index;
388 for (UINTN BlockIndex = 0; BlockIndex < BlockWidth; BlockIndex++) {
390 #pragma clang loop unroll(full)
392 for (UINTN BlockIndex2 = 0; BlockIndex2 < BlockWidth; BlockIndex2++) {
393 B[BlockIndex - BlockIndex2 * PixelsPerScanLine] = A[BlockIndex * DeltaPixels + BlockIndex2];
402 CONST UINTN BlockWidth = 2;
403 Destination += (Configure->Height - DestinationX - 1) * PixelsPerScanLine;
404 for (UINTN Index = 0; Index < Height; Index += BlockWidth) {
405 for (UINTN Index2 = 0; Index2 < Width; Index2 += BlockWidth) {
406 UINT32 *A = Source + Index * DeltaPixels + Index2;
407 UINT32 *B = Destination - Index2 * PixelsPerScanLine + Index;
408 for (UINTN BlockIndex = 0; BlockIndex < BlockWidth; BlockIndex++) {
410 #pragma clang loop unroll(full)
412 for (UINTN BlockIndex2 = 0; BlockIndex2 < BlockWidth; BlockIndex2++) {
413 B[BlockIndex - BlockIndex2 * PixelsPerScanLine] = A[BlockIndex * DeltaPixels + BlockIndex2];
425 DestinationWalker = Destination;
426 SourceWalker = Source;
427 LastX = Configure->Height - DestinationX - 1;
428 for (IndexX = 0; IndexX < Width; IndexX++) {
429 DestinationWalker[(LastX - IndexX) * PixelsPerScanLine] = *SourceWalker++;
432 Source += DeltaPixels;
438 DestinationWalker = Destination;
439 SourceWalker = Source;
440 LastX = Configure->Height - DestinationX - 1;
441 for (IndexX = 0; IndexX < Width; IndexX++) {
442 Uint32 = *SourceWalker++;
443 DestinationWalker[(LastX - IndexX) * PixelsPerScanLine] =
445 (((Uint32 << Configure->PixelShl[0]) >> Configure->PixelShr[0]) &
446 Configure->PixelMasks.RedMask) |
447 (((Uint32 << Configure->PixelShl[1]) >> Configure->PixelShr[1]) &
448 Configure->PixelMasks.GreenMask) |
449 (((Uint32 << Configure->PixelShl[2]) >> Configure->PixelShr[2]) &
450 Configure->PixelMasks.BlueMask)
454 Source += DeltaPixels;