1 /*
2  * PROJECT:         ReactOS VGA display driver
3  * LICENSE:         GPL - See COPYING in the top level directory
4  * FILE:            win32ss/drivers/displays/vga/objects/copybits.c
5  * PURPOSE:
6  * PROGRAMMERS:
7  */
8 
9 #include <vgaddi.h>
10 
11 BOOL APIENTRY
12 DrvCopyBits(
13     OUT SURFOBJ*  DestObj,
14     IN  SURFOBJ*  SourceObj,
15     IN  CLIPOBJ*  ClipObj,
16     IN  XLATEOBJ* XLateObj,
17     IN  RECTL*    DestRectL,
18     IN  POINTL*   SrcPointL)
19 {
20     BOOL Done = FALSE;
21 
22     if (STYPE_BITMAP == DestObj->iType && BMF_4BPP == DestObj->iBitmapFormat &&
23         STYPE_DEVICE == SourceObj->iType)
24     {
25         /* Screen to 4 BPP DIB */
26         DIB_BltFromVGA(SrcPointL->x, SrcPointL->y,
27                        DestRectL->right - DestRectL->left,
28                        DestRectL->bottom - DestRectL->top,
29                        DestObj->pvScan0, DestObj->lDelta);
30         Done = TRUE;
31     }
32     else if (STYPE_DEVICE == DestObj->iType &&
33              STYPE_BITMAP == SourceObj->iType && BMF_4BPP == SourceObj->iBitmapFormat)
34     {
35         /* 4 BPP DIB to Screen */
36         DIB_BltToVGA(DestRectL->left, DestRectL->top,
37                      DestRectL->right - DestRectL->left,
38                      DestRectL->bottom - DestRectL->top,
39                      SourceObj->pvScan0, SourceObj->lDelta,
40                      0);
41         Done = TRUE;
42     }
43 
44     return Done;
45 }
46