2 * FreeRDP: A Remote Desktop Protocol Client
3 * GDI 32bpp Internal Buffer Routines
5 * Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
23 #include <freerdp/api.h>
24 #include <freerdp/freerdp.h>
25 #include <freerdp/gdi/gdi.h>
26 #include <freerdp/codec/color.h>
28 #include <freerdp/gdi/pen.h>
29 #include <freerdp/gdi/bitmap.h>
30 #include <freerdp/gdi/region.h>
31 #include <freerdp/gdi/clipping.h>
32 #include <freerdp/gdi/drawing.h>
34 #include <freerdp/gdi/32bpp.h>
36 uint32 gdi_get_color_32bpp(HGDI_DC hdc, GDI_COLOR color)
42 GetBGR32(r, g, b, color);
46 color32 = ABGR32(a, r, g, b);
50 color32 = ARGB32(a, r, g, b);
56 int FillRect_32bpp(HGDI_DC hdc, HGDI_RECT rect, HGDI_BRUSH hbr)
64 gdi_RectToCRgn(rect, &nXDest, &nYDest, &nWidth, &nHeight);
66 if (gdi_ClipCoords(hdc, &nXDest, &nYDest, &nWidth, &nHeight, NULL, NULL) == 0)
69 color32 = gdi_get_color_32bpp(hdc, hbr->color);
71 for (y = 0; y < nHeight; y++)
73 dstp = (uint32*) gdi_get_bitmap_pointer(hdc, nXDest, nYDest + y);
77 for (x = 0; x < nWidth; x++)
85 gdi_InvalidateRegion(hdc, nXDest, nYDest, nWidth, nHeight);
89 static int BitBlt_BLACKNESS_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
96 for (y = 0; y < nHeight; y++)
98 dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
102 for (x = 0; x < nWidth; x++)
124 for (y = 0; y < nHeight; y++)
126 dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
129 memset(dstp, 0, nWidth * hdcDest->bytesPerPixel);
136 static int BitBlt_WHITENESS_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
141 for (y = 0; y < nHeight; y++)
143 dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
146 memset(dstp, 0xFF, nWidth * hdcDest->bytesPerPixel);
152 static int BitBlt_SRCCOPY_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
158 if ((hdcDest->selectedObject != hdcSrc->selectedObject) ||
159 gdi_CopyOverlap(nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc) == 0)
161 for (y = 0; y < nHeight; y++)
163 srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
164 dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
166 if (srcp != 0 && dstp != 0)
167 memcpy(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
175 /* copy down (bottom to top) */
176 for (y = nHeight - 1; y >= 0; y--)
178 srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
179 dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
181 if (srcp != 0 && dstp != 0)
182 memmove(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
185 else if (nYSrc > nYDest || nXSrc > nXDest)
187 /* copy up or left (top top bottom) */
188 for (y = 0; y < nHeight; y++)
190 srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
191 dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
193 if (srcp != 0 && dstp != 0)
194 memmove(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
199 /* copy straight right */
200 for (y = 0; y < nHeight; y++)
202 srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
203 dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
205 if (srcp != 0 && dstp != 0)
206 memmove(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
213 static int BitBlt_NOTSRCCOPY_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
219 for (y = 0; y < nHeight; y++)
221 srcp = (uint32*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
222 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
226 for (x = 0; x < nWidth; x++)
238 static int BitBlt_DSTINVERT_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
243 for (y = 0; y < nHeight; y++)
245 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
249 for (x = 0; x < nWidth; x++)
260 static int BitBlt_SRCERASE_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
266 for (y = 0; y < nHeight; y++)
268 srcp = (uint32*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
269 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
273 for (x = 0; x < nWidth; x++)
275 *dstp = *srcp & ~(*dstp);
285 static int BitBlt_NOTSRCERASE_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
291 for (y = 0; y < nHeight; y++)
293 srcp = (uint32*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
294 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
298 for (x = 0; x < nWidth; x++)
300 *dstp = ~(*srcp) & ~(*dstp);
310 static int BitBlt_SRCINVERT_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
316 for (y = 0; y < nHeight; y++)
318 srcp = (uint32*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
319 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
323 for (x = 0; x < nWidth; x++)
335 static int BitBlt_SRCAND_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
341 for (y = 0; y < nHeight; y++)
343 srcp = (uint32*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
344 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
348 for (x = 0; x < nWidth; x++)
360 static int BitBlt_SRCPAINT_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
366 for (y = 0; y < nHeight; y++)
368 srcp = (uint32*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
369 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
373 for (x = 0; x < nWidth; x++)
385 static int BitBlt_DSPDxax_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
394 /* D = (S & P) | (~S & D) */
395 /* DSPDxax, used to draw glyphs */
397 color32 = gdi_get_color_32bpp(hdcDest, hdcDest->textColor);
399 hSrcBmp = (HGDI_BITMAP) hdcSrc->selectedObject;
400 srcp = hSrcBmp->data;
402 if (hdcSrc->bytesPerPixel != 1)
404 printf("BitBlt_DSPDxax expects 1 bpp, unimplemented for %d\n", hdcSrc->bytesPerPixel);
408 for (y = 0; y < nHeight; y++)
410 srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
411 dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
415 for (x = 0; x < nWidth; x++)
417 patp = (uint8*) &color32;
419 *dstp = (*srcp & *patp) | (~(*srcp) & *dstp);
423 *dstp = (*srcp & *patp) | (~(*srcp) & *dstp);
427 *dstp = (*srcp & *patp) | (~(*srcp) & *dstp);
437 static int BitBlt_SPna_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
444 for (y = 0; y < nHeight; y++)
446 srcp = (uint32*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
447 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
451 for (x = 0; x < nWidth; x++)
453 patp = (uint32*) gdi_get_brush_pointer(hdcDest, x, y);
455 *dstp = *srcp & ~(*patp);
465 static int BitBlt_DSna_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
471 for (y = 0; y < nHeight; y++)
473 srcp = (uint32*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
474 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
478 for (x = 0; x < nWidth; x++)
480 *dstp = ~(*srcp) & (*dstp);
490 static int BitBlt_PDxn_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
496 for (y = 0; y < nHeight; y++)
498 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
502 for (x = 0; x < nWidth; x++)
504 patp = (uint32*) gdi_get_brush_pointer(hdcDest, x, y);
506 *dstp = *dstp ^ ~(*patp);
515 static int BitBlt_MERGECOPY_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
522 for (y = 0; y < nHeight; y++)
524 srcp = (uint32*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
525 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
529 for (x = 0; x < nWidth; x++)
531 patp = (uint32*) gdi_get_brush_pointer(hdcDest, x, y);
533 *dstp = *srcp & *patp;
543 static int BitBlt_MERGEPAINT_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
549 for (y = 0; y < nHeight; y++)
551 srcp = (uint32*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
552 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
556 for (x = 0; x < nWidth; x++)
558 *dstp = ~(*srcp) | *dstp;
568 static int BitBlt_PATCOPY_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
575 if (hdcDest->brush->style == GDI_BS_SOLID)
577 color32 = gdi_get_color_32bpp(hdcDest, hdcDest->brush->color);
579 for (y = 0; y < nHeight; y++)
581 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
585 for (x = 0; x < nWidth; x++)
595 for (y = 0; y < nHeight; y++)
597 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
601 for (x = 0; x < nWidth; x++)
603 patp = (uint32*) gdi_get_brush_pointer(hdcDest, x, y);
614 static int BitBlt_PATINVERT_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
621 if (hdcDest->brush->style == GDI_BS_SOLID)
623 color32 = gdi_get_color_32bpp(hdcDest, hdcDest->brush->color);
625 for (y = 0; y < nHeight; y++)
627 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
631 for (x = 0; x < nWidth; x++)
641 for (y = 0; y < nHeight; y++)
643 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
647 for (x = 0; x < nWidth; x++)
649 patp = (uint32*) gdi_get_brush_pointer(hdcDest, x, y);
650 *dstp = *patp ^ *dstp;
660 static int BitBlt_PATPAINT_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
667 for (y = 0; y < nHeight; y++)
669 srcp = (uint32*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
670 dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
674 for (x = 0; x < nWidth; x++)
676 patp = (uint32*) gdi_get_brush_pointer(hdcDest, x, y);
677 *dstp = *dstp | (*patp | ~(*srcp));
687 int BitBlt_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, int rop)
691 if (gdi_ClipCoords(hdcDest, &nXDest, &nYDest, &nWidth, &nHeight, &nXSrc, &nYSrc) == 0)
696 if (gdi_ClipCoords(hdcDest, &nXDest, &nYDest, &nWidth, &nHeight, NULL, NULL) == 0)
700 gdi_InvalidateRegion(hdcDest, nXDest, nYDest, nWidth, nHeight);
705 return BitBlt_BLACKNESS_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
709 return BitBlt_WHITENESS_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
713 return BitBlt_SRCCOPY_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
717 return BitBlt_SPna_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
721 return BitBlt_DSna_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
725 return BitBlt_DSPDxax_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
729 return BitBlt_NOTSRCCOPY_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
733 return BitBlt_DSTINVERT_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
737 return BitBlt_SRCERASE_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
740 case GDI_NOTSRCERASE:
741 return BitBlt_NOTSRCERASE_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
745 return BitBlt_SRCINVERT_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
749 return BitBlt_SRCAND_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
753 return BitBlt_SRCPAINT_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
757 return BitBlt_MERGECOPY_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
761 return BitBlt_MERGEPAINT_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
765 return BitBlt_PATCOPY_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
769 return BitBlt_PATINVERT_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
773 return BitBlt_PATPAINT_32bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
777 printf("BitBlt: unknown rop: 0x%08X\n", rop);
781 int PatBlt_32bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, int rop)
783 if (gdi_ClipCoords(hdc, &nXLeft, &nYLeft, &nWidth, &nHeight, NULL, NULL) == 0)
786 gdi_InvalidateRegion(hdc, nXLeft, nYLeft, nWidth, nHeight);
791 return BitBlt_PATCOPY_32bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
795 return BitBlt_PATINVERT_32bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
799 return BitBlt_DSTINVERT_32bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
803 return BitBlt_BLACKNESS_32bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
807 return BitBlt_WHITENESS_32bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
811 return BitBlt_PDxn_32bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
818 printf("PatBlt: unknown rop: 0x%08X\n", rop);
823 INLINE void SetPixel_BLACK_32bpp(uint32* pixel, uint32* pen)
829 INLINE void SetPixel_NOTMERGEPEN_32bpp(uint32* pixel, uint32* pen)
832 *pixel = ~(*pixel | *pen);
835 INLINE void SetPixel_MASKNOTPEN_32bpp(uint32* pixel, uint32* pen)
841 INLINE void SetPixel_NOTCOPYPEN_32bpp(uint32* pixel, uint32* pen)
847 INLINE void SetPixel_MASKPENNOT_32bpp(uint32* pixel, uint32* pen)
850 *pixel = *pen & ~*pixel;
853 INLINE void SetPixel_NOT_32bpp(uint32* pixel, uint32* pen)
859 INLINE void SetPixel_XORPEN_32bpp(uint32* pixel, uint32* pen)
862 *pixel = *pixel ^ *pen;
865 INLINE void SetPixel_NOTMASKPEN_32bpp(uint32* pixel, uint32* pen)
868 *pixel = ~(*pixel & *pen);
871 INLINE void SetPixel_MASKPEN_32bpp(uint32* pixel, uint32* pen)
877 INLINE void SetPixel_NOTXORPEN_32bpp(uint32* pixel, uint32* pen)
880 *pixel = ~(*pixel ^ *pen);
883 INLINE void SetPixel_NOP_32bpp(uint32* pixel, uint32* pen)
888 INLINE void SetPixel_MERGENOTPEN_32bpp(uint32* pixel, uint32* pen)
894 INLINE void SetPixel_COPYPEN_32bpp(uint32* pixel, uint32* pen)
900 INLINE void SetPixel_MERGEPENNOT_32bpp(uint32* pixel, uint32* pen)
903 *pixel = *pen | ~(*pixel);
906 INLINE void SetPixel_MERGEPEN_32bpp(uint32* pixel, uint32* pen)
912 INLINE void SetPixel_WHITE_32bpp(uint32* pixel, uint32* pen)
918 #define PIXEL_TYPE uint32
919 #define GDI_GET_POINTER gdi_GetPointer_32bpp
920 #define GDI_GET_PEN_COLOR gdi_GetPenColor_32bpp
922 #define LINE_TO LineTo_BLACK_32bpp
923 #define SET_PIXEL_ROP2 SetPixel_BLACK_32bpp
924 #include "include/line.c"
926 #undef SET_PIXEL_ROP2
928 #define LINE_TO LineTo_NOTMERGEPEN_32bpp
929 #define SET_PIXEL_ROP2 SetPixel_NOTMERGEPEN_32bpp
930 #include "include/line.c"
932 #undef SET_PIXEL_ROP2
934 #define LINE_TO LineTo_MASKNOTPEN_32bpp
935 #define SET_PIXEL_ROP2 SetPixel_MASKNOTPEN_32bpp
936 #include "include/line.c"
938 #undef SET_PIXEL_ROP2
940 #define LINE_TO LineTo_NOTCOPYPEN_32bpp
941 #define SET_PIXEL_ROP2 SetPixel_NOTCOPYPEN_32bpp
942 #include "include/line.c"
944 #undef SET_PIXEL_ROP2
946 #define LINE_TO LineTo_MASKPENNOT_32bpp
947 #define SET_PIXEL_ROP2 SetPixel_MASKPENNOT_32bpp
948 #include "include/line.c"
950 #undef SET_PIXEL_ROP2
952 #define LINE_TO LineTo_NOT_32bpp
953 #define SET_PIXEL_ROP2 SetPixel_NOT_32bpp
954 #include "include/line.c"
956 #undef SET_PIXEL_ROP2
958 #define LINE_TO LineTo_XORPEN_32bpp
959 #define SET_PIXEL_ROP2 SetPixel_XORPEN_32bpp
960 #include "include/line.c"
962 #undef SET_PIXEL_ROP2
964 #define LINE_TO LineTo_NOTMASKPEN_32bpp
965 #define SET_PIXEL_ROP2 SetPixel_NOTMASKPEN_32bpp
966 #include "include/line.c"
968 #undef SET_PIXEL_ROP2
970 #define LINE_TO LineTo_MASKPEN_32bpp
971 #define SET_PIXEL_ROP2 SetPixel_MASKPEN_32bpp
972 #include "include/line.c"
974 #undef SET_PIXEL_ROP2
976 #define LINE_TO LineTo_NOTXORPEN_32bpp
977 #define SET_PIXEL_ROP2 SetPixel_NOTXORPEN_32bpp
978 #include "include/line.c"
980 #undef SET_PIXEL_ROP2
982 #define LINE_TO LineTo_NOP_32bpp
983 #define SET_PIXEL_ROP2 SetPixel_NOP_32bpp
984 #include "include/line.c"
986 #undef SET_PIXEL_ROP2
988 #define LINE_TO LineTo_MERGENOTPEN_32bpp
989 #define SET_PIXEL_ROP2 SetPixel_MERGENOTPEN_32bpp
990 #include "include/line.c"
992 #undef SET_PIXEL_ROP2
994 #define LINE_TO LineTo_COPYPEN_32bpp
995 #define SET_PIXEL_ROP2 SetPixel_COPYPEN_32bpp
996 #include "include/line.c"
998 #undef SET_PIXEL_ROP2
1000 #define LINE_TO LineTo_MERGEPENNOT_32bpp
1001 #define SET_PIXEL_ROP2 SetPixel_MERGEPENNOT_32bpp
1002 #include "include/line.c"
1004 #undef SET_PIXEL_ROP2
1006 #define LINE_TO LineTo_MERGEPEN_32bpp
1007 #define SET_PIXEL_ROP2 SetPixel_MERGEPEN_32bpp
1008 #include "include/line.c"
1010 #undef SET_PIXEL_ROP2
1012 #define LINE_TO LineTo_WHITE_32bpp
1013 #define SET_PIXEL_ROP2 SetPixel_WHITE_32bpp
1014 #include "include/line.c"
1016 #undef SET_PIXEL_ROP2
1019 #undef GDI_GET_POINTER
1020 #undef GDI_GET_PEN_COLOR
1022 pLineTo_32bpp LineTo_ROP2_32bpp[32] =
1025 LineTo_NOTMERGEPEN_32bpp,
1026 LineTo_MASKNOTPEN_32bpp,
1027 LineTo_NOTCOPYPEN_32bpp,
1028 LineTo_MASKPENNOT_32bpp,
1030 LineTo_XORPEN_32bpp,
1031 LineTo_NOTMASKPEN_32bpp,
1032 LineTo_MASKPEN_32bpp,
1033 LineTo_NOTXORPEN_32bpp,
1035 LineTo_MERGENOTPEN_32bpp,
1036 LineTo_COPYPEN_32bpp,
1037 LineTo_MERGEPENNOT_32bpp,
1038 LineTo_MERGEPEN_32bpp,
1042 int LineTo_32bpp(HGDI_DC hdc, int nXEnd, int nYEnd)
1044 pLineTo_32bpp _LineTo;
1045 int rop2 = gdi_GetROP2(hdc) - 1;
1047 _LineTo = LineTo_ROP2_32bpp[rop2];
1049 if (_LineTo != NULL)
1050 return _LineTo(hdc, nXEnd, nYEnd);