2011-07-01 00:17:55 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2011-07-01 00:17:55 +04:00
|
|
|
* GDI 16bpp Internal Buffer Routines
|
|
|
|
*
|
|
|
|
* Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2012-08-15 01:09:01 +04:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
2012-08-15 01:09:01 +04:00
|
|
|
|
2011-08-31 12:35:50 +04:00
|
|
|
#include <freerdp/api.h>
|
2014-09-12 16:36:29 +04:00
|
|
|
#include <freerdp/log.h>
|
2011-07-01 00:17:55 +04:00
|
|
|
#include <freerdp/freerdp.h>
|
2011-08-15 22:33:04 +04:00
|
|
|
#include <freerdp/gdi/gdi.h>
|
2011-10-03 04:28:20 +04:00
|
|
|
#include <freerdp/codec/color.h>
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2011-08-22 21:08:01 +04:00
|
|
|
#include <freerdp/gdi/pen.h>
|
|
|
|
#include <freerdp/gdi/bitmap.h>
|
|
|
|
#include <freerdp/gdi/region.h>
|
|
|
|
#include <freerdp/gdi/clipping.h>
|
|
|
|
#include <freerdp/gdi/drawing.h>
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2011-08-22 21:08:01 +04:00
|
|
|
#include <freerdp/gdi/16bpp.h>
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2014-09-12 16:36:29 +04:00
|
|
|
#define TAG FREERDP_TAG("gdi")
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16 gdi_get_color_16bpp(HGDI_DC hdc, GDI_COLOR color)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE r, g, b;
|
|
|
|
UINT16 color16;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2014-08-07 01:58:58 +04:00
|
|
|
GetRGB32(r, g, b, color);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2011-12-30 23:23:47 +04:00
|
|
|
if (hdc->rgb555)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
if (hdc->invert)
|
|
|
|
{
|
|
|
|
color16 = BGR15(r, g, b);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
color16 = RGB15(r, g, b);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (hdc->invert)
|
|
|
|
{
|
|
|
|
color16 = BGR16(r, g, b);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
color16 = RGB16(r, g, b);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return color16;
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
BOOL FillRect_16bpp(HGDI_DC hdc, HGDI_RECT rect, HGDI_BRUSH hbr)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16 *dstp;
|
2011-07-01 00:17:55 +04:00
|
|
|
int nXDest, nYDest;
|
|
|
|
int nWidth, nHeight;
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16 color16;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
gdi_RectToCRgn(rect, &nXDest, &nYDest, &nWidth, &nHeight);
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
if (!gdi_ClipCoords(hdc, &nXDest, &nYDest, &nWidth, &nHeight, NULL, NULL))
|
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
color16 = gdi_get_color_16bpp(hdc, hbr->color);
|
|
|
|
|
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdc, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
|
|
|
*dstp = color16;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-17 17:21:55 +03:00
|
|
|
if (!gdi_InvalidateRegion(hdc, nXDest, nYDest, nWidth, nHeight))
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_BLACKNESS_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int y;
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE* dstp;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
|
|
|
dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
memset(dstp, 0, nWidth * hdcDest->bytesPerPixel);
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_WHITENESS_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int y;
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE* dstp;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
|
|
|
dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
memset(dstp, 0xFF, nWidth * hdcDest->bytesPerPixel);
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_SRCCOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int y;
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE* srcp;
|
|
|
|
BYTE* dstp;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2013-08-30 16:47:00 +04:00
|
|
|
if (!hdcSrc || !hdcDest)
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-30 16:47:00 +04:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
if ((hdcDest->selectedObject != hdcSrc->selectedObject) ||
|
2015-06-26 15:32:38 +03:00
|
|
|
!gdi_CopyOverlap(nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc))
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
|
|
|
srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
|
|
|
|
|
|
|
if (srcp != 0 && dstp != 0)
|
2011-09-30 07:19:13 +04:00
|
|
|
memcpy(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (nYSrc < nYDest)
|
|
|
|
{
|
|
|
|
/* copy down (bottom to top) */
|
|
|
|
for (y = nHeight - 1; y >= 0; y--)
|
|
|
|
{
|
|
|
|
srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
|
|
|
|
|
|
|
if (srcp != 0 && dstp != 0)
|
2011-09-30 07:19:13 +04:00
|
|
|
memmove(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (nYSrc > nYDest || nXSrc > nXDest)
|
|
|
|
{
|
|
|
|
/* copy up or left (top top bottom) */
|
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
|
|
|
srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
|
|
|
|
|
|
|
if (srcp != 0 && dstp != 0)
|
2011-09-30 07:19:13 +04:00
|
|
|
memmove(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* copy straight right */
|
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
|
|
|
srcp = gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
|
|
|
|
|
|
|
if (srcp != 0 && dstp != 0)
|
2011-09-30 07:19:13 +04:00
|
|
|
memmove(dstp, srcp, nWidth * hdcDest->bytesPerPixel);
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_NOTSRCCOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* srcp;
|
|
|
|
UINT16* dstp;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2013-08-30 16:47:00 +04:00
|
|
|
if (!hdcSrc || !hdcDest)
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-30 16:47:00 +04:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
|
|
|
*dstp = ~(*srcp);
|
|
|
|
srcp++;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_DSTINVERT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* dstp;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
|
|
|
*dstp = ~(*dstp);
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_SRCERASE_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* srcp;
|
|
|
|
UINT16* dstp;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2013-08-30 16:47:00 +04:00
|
|
|
if (!hdcSrc || !hdcDest)
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-30 16:47:00 +04:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
|
|
|
*dstp = *srcp & ~(*dstp);
|
|
|
|
srcp++;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_NOTSRCERASE_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* srcp;
|
|
|
|
UINT16* dstp;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2013-08-30 16:47:00 +04:00
|
|
|
if (!hdcSrc || !hdcDest)
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-30 16:47:00 +04:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
|
|
|
*dstp = ~(*srcp) & ~(*dstp);
|
|
|
|
srcp++;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_SRCINVERT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* srcp;
|
|
|
|
UINT16* dstp;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2013-08-30 16:47:00 +04:00
|
|
|
if (!hdcSrc || !hdcDest)
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-30 16:47:00 +04:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
|
|
|
*dstp ^= *srcp;
|
|
|
|
srcp++;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_SRCAND_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* srcp;
|
|
|
|
UINT16* dstp;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2013-08-30 16:47:00 +04:00
|
|
|
if (!hdcSrc || !hdcDest)
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-30 16:47:00 +04:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
|
|
|
*dstp &= *srcp;
|
|
|
|
srcp++;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_SRCPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* srcp;
|
|
|
|
UINT16* dstp;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2013-08-30 16:47:00 +04:00
|
|
|
if (!hdcSrc || !hdcDest)
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-30 16:47:00 +04:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
|
|
|
*dstp |= *srcp;
|
|
|
|
srcp++;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_DSPDxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE* srcp;
|
|
|
|
UINT16* dstp;
|
|
|
|
UINT16 src16;
|
|
|
|
UINT16 color16;
|
2011-07-01 00:17:55 +04:00
|
|
|
HGDI_BITMAP hSrcBmp;
|
|
|
|
|
2013-08-30 18:29:25 +04:00
|
|
|
if (!hdcDest || !hdcSrc)
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-30 16:47:00 +04:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
/* D = (S & P) | (~S & D) */
|
|
|
|
/* DSPDxax, used to draw glyphs */
|
|
|
|
|
|
|
|
color16 = gdi_get_color_16bpp(hdcDest, hdcDest->textColor);
|
|
|
|
|
|
|
|
hSrcBmp = (HGDI_BITMAP) hdcSrc->selectedObject;
|
|
|
|
|
|
|
|
if (hdcSrc->bytesPerPixel != 1)
|
|
|
|
{
|
2014-09-12 16:36:29 +04:00
|
|
|
WLog_ERR(TAG, "BitBlt_DSPDxax expects 1 bpp, unimplemented for %d",
|
|
|
|
hdcSrc->bytesPerPixel);
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
srcp = (BYTE*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
2012-01-09 02:43:07 +04:00
|
|
|
src16 = (*srcp << 8) | *srcp;
|
|
|
|
*dstp = (src16 & color16) | (~src16 & *dstp);
|
2011-07-01 00:17:55 +04:00
|
|
|
srcp++;
|
2011-08-20 00:01:47 +04:00
|
|
|
dstp++;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_PSDPxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
|
2012-02-13 04:41:39 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* srcp;
|
|
|
|
UINT16* dstp;
|
|
|
|
UINT16* patp;
|
|
|
|
UINT16 color16;
|
2012-02-13 04:41:39 +04:00
|
|
|
|
2013-08-30 16:47:00 +04:00
|
|
|
if (!hdcSrc || !hdcDest)
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-30 16:47:00 +04:00
|
|
|
|
2012-02-13 04:41:39 +04:00
|
|
|
/* D = (S & D) | (~S & P) */
|
|
|
|
|
|
|
|
if (hdcDest->brush->style == GDI_BS_SOLID)
|
|
|
|
{
|
|
|
|
color16 = gdi_get_color_16bpp(hdcDest, hdcDest->brush->color);
|
2012-10-09 11:01:37 +04:00
|
|
|
patp = (UINT16*) &color16;
|
2012-02-13 04:41:39 +04:00
|
|
|
|
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2012-02-13 04:41:39 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
|
|
|
*dstp = (*srcp & *dstp) | (~(*srcp) & *patp);
|
|
|
|
srcp++;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2012-02-13 04:41:39 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
|
2012-02-13 04:41:39 +04:00
|
|
|
*dstp = (*srcp & *dstp) | (~(*srcp) & *patp);
|
|
|
|
srcp++;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2012-02-13 04:41:39 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_SPna_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* srcp;
|
|
|
|
UINT16* dstp;
|
|
|
|
UINT16* patp;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2013-08-30 16:47:00 +04:00
|
|
|
if (!hdcSrc || !hdcDest)
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-30 16:47:00 +04:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
|
2011-07-01 00:17:55 +04:00
|
|
|
*dstp = *srcp & ~(*patp);
|
|
|
|
srcp++;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_DPa_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
|
2012-02-13 00:21:08 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* dstp;
|
|
|
|
UINT16* patp;
|
2012-02-13 00:21:08 +04:00
|
|
|
|
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2012-02-13 00:21:08 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
|
2012-02-13 00:21:08 +04:00
|
|
|
|
|
|
|
*dstp = *dstp & *patp;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2012-02-13 00:21:08 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_PDxn_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
|
2011-08-19 22:14:13 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* dstp;
|
|
|
|
UINT16* patp;
|
2011-08-19 22:14:13 +04:00
|
|
|
|
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-08-19 22:14:13 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
|
2011-08-19 22:14:13 +04:00
|
|
|
*dstp = *dstp ^ ~(*patp);
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-08-19 22:14:13 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_DSna_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* srcp;
|
|
|
|
UINT16* dstp;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2013-08-30 16:47:00 +04:00
|
|
|
if (!hdcSrc || !hdcDest)
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-30 16:47:00 +04:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
|
|
|
*dstp = ~(*srcp) & (*dstp);
|
|
|
|
srcp++;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_MERGECOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* srcp;
|
|
|
|
UINT16* dstp;
|
|
|
|
UINT16* patp;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2013-08-30 16:47:00 +04:00
|
|
|
if (!hdcSrc || !hdcDest)
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-30 16:47:00 +04:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
|
2011-07-01 00:17:55 +04:00
|
|
|
*dstp = *srcp & *patp;
|
|
|
|
srcp++;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_MERGEPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* srcp;
|
|
|
|
UINT16* dstp;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2013-08-30 16:47:00 +04:00
|
|
|
if (!hdcSrc || !hdcDest)
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-30 16:47:00 +04:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
|
|
|
*dstp = ~(*srcp) | *dstp;
|
|
|
|
srcp++;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_PATCOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
2013-02-04 18:58:22 +04:00
|
|
|
int x, y, xOffset, yOffset;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* dstp;
|
|
|
|
UINT16* patp;
|
|
|
|
UINT16 color16;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2011-12-30 23:23:47 +04:00
|
|
|
if (hdcDest->brush->style == GDI_BS_SOLID)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
color16 = gdi_get_color_16bpp(hdcDest, hdcDest->brush->color);
|
|
|
|
|
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2011-08-20 00:01:47 +04:00
|
|
|
if (dstp != 0)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
2011-08-20 00:01:47 +04:00
|
|
|
*dstp = color16;
|
|
|
|
dstp++;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-02-04 18:58:22 +04:00
|
|
|
/* align pattern to 8x8 grid to make sure transition
|
|
|
|
between different pattern blocks are smooth */
|
|
|
|
|
|
|
|
if (hdcDest->brush->style == GDI_BS_HATCHED)
|
|
|
|
{
|
|
|
|
xOffset = nXDest % 8;
|
|
|
|
yOffset = nYDest % 8 + 2; // +2 added after comparison to mstsc
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
xOffset = 0;
|
|
|
|
yOffset = 0;
|
|
|
|
}
|
2011-07-01 00:17:55 +04:00
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
2013-02-04 18:58:22 +04:00
|
|
|
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x+xOffset, y+yOffset);
|
2011-07-01 00:17:55 +04:00
|
|
|
*dstp = *patp;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_PATINVERT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* dstp;
|
|
|
|
UINT16* patp;
|
|
|
|
UINT16 color16;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2011-12-30 23:23:47 +04:00
|
|
|
if (hdcDest->brush->style == GDI_BS_SOLID)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
color16 = gdi_get_color_16bpp(hdcDest, hdcDest->brush->color);
|
|
|
|
|
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2011-08-20 00:01:47 +04:00
|
|
|
if (dstp != 0)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
2011-08-20 00:01:47 +04:00
|
|
|
*dstp ^= color16;
|
|
|
|
dstp++;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
|
2011-07-01 00:17:55 +04:00
|
|
|
*dstp = *patp ^ *dstp;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
static BOOL BitBlt_PATPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
int x, y;
|
2012-10-09 11:01:37 +04:00
|
|
|
UINT16* srcp;
|
|
|
|
UINT16* dstp;
|
|
|
|
UINT16* patp;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2013-08-30 16:47:00 +04:00
|
|
|
if (!hdcSrc || !hdcDest)
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-30 16:47:00 +04:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
for (y = 0; y < nHeight; y++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
|
|
|
|
dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
if (dstp != 0)
|
|
|
|
{
|
|
|
|
for (x = 0; x < nWidth; x++)
|
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
|
2011-07-01 00:17:55 +04:00
|
|
|
*dstp = *dstp | (*patp | ~(*srcp));
|
|
|
|
srcp++;
|
|
|
|
dstp++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
BOOL BitBlt_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, DWORD rop)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
2013-08-29 12:51:36 +04:00
|
|
|
if (!hdcDest)
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-29 12:51:36 +04:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
if (hdcSrc != NULL)
|
|
|
|
{
|
2015-06-26 15:32:38 +03:00
|
|
|
if (!gdi_ClipCoords(hdcDest, &nXDest, &nYDest, &nWidth, &nHeight, &nXSrc, &nYSrc))
|
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-06-26 15:32:38 +03:00
|
|
|
if (!gdi_ClipCoords(hdcDest, &nXDest, &nYDest, &nWidth, &nHeight, NULL, NULL))
|
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-04-17 17:21:55 +03:00
|
|
|
if (!gdi_InvalidateRegion(hdcDest, nXDest, nYDest, nWidth, nHeight))
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2013-08-30 16:47:00 +04:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
switch (rop)
|
|
|
|
{
|
|
|
|
case GDI_BLACKNESS:
|
|
|
|
return BitBlt_BLACKNESS_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
|
|
|
|
|
|
|
|
case GDI_WHITENESS:
|
|
|
|
return BitBlt_WHITENESS_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
|
|
|
|
|
|
|
|
case GDI_SRCCOPY:
|
|
|
|
return BitBlt_SRCCOPY_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
|
|
|
|
|
|
|
|
case GDI_SPna:
|
|
|
|
return BitBlt_SPna_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
|
|
|
|
|
|
|
|
case GDI_DSna:
|
|
|
|
return BitBlt_DSna_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
|
|
|
|
|
|
|
|
case GDI_DSPDxax:
|
|
|
|
return BitBlt_DSPDxax_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
|
2015-03-10 14:53:31 +03:00
|
|
|
|
2012-02-13 04:41:39 +04:00
|
|
|
case GDI_PSDPxax:
|
|
|
|
return BitBlt_PSDPxax_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
|
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
case GDI_NOTSRCCOPY:
|
|
|
|
return BitBlt_NOTSRCCOPY_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
|
|
|
|
|
|
|
|
case GDI_DSTINVERT:
|
|
|
|
return BitBlt_DSTINVERT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
|
|
|
|
|
|
|
|
case GDI_SRCERASE:
|
|
|
|
return BitBlt_SRCERASE_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
|
|
|
|
|
|
|
|
case GDI_NOTSRCERASE:
|
|
|
|
return BitBlt_NOTSRCERASE_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
|
|
|
|
|
|
|
|
case GDI_SRCINVERT:
|
|
|
|
return BitBlt_SRCINVERT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
|
|
|
|
|
|
|
|
case GDI_SRCAND:
|
|
|
|
return BitBlt_SRCAND_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
|
|
|
|
|
|
|
|
case GDI_SRCPAINT:
|
|
|
|
return BitBlt_SRCPAINT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
|
|
|
|
|
|
|
|
case GDI_MERGECOPY:
|
|
|
|
return BitBlt_MERGECOPY_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
|
|
|
|
|
|
|
|
case GDI_MERGEPAINT:
|
|
|
|
return BitBlt_MERGEPAINT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
|
|
|
|
|
|
|
|
case GDI_PATCOPY:
|
|
|
|
return BitBlt_PATCOPY_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
|
|
|
|
|
|
|
|
case GDI_PATINVERT:
|
|
|
|
return BitBlt_PATINVERT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight);
|
|
|
|
|
|
|
|
case GDI_PATPAINT:
|
|
|
|
return BitBlt_PATPAINT_16bpp(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc);
|
|
|
|
}
|
2014-09-12 16:36:29 +04:00
|
|
|
|
|
|
|
WLog_ERR(TAG, "BitBlt: unknown rop: 0x%08X", rop);
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
BOOL PatBlt_16bpp(HGDI_DC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, DWORD rop)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
2015-06-26 15:32:38 +03:00
|
|
|
if (!gdi_ClipCoords(hdc, &nXLeft, &nYLeft, &nWidth, &nHeight, NULL, NULL))
|
|
|
|
return TRUE;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2015-04-17 17:21:55 +03:00
|
|
|
if (!gdi_InvalidateRegion(hdc, nXLeft, nYLeft, nWidth, nHeight))
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
|
|
|
switch (rop)
|
|
|
|
{
|
|
|
|
case GDI_PATCOPY:
|
|
|
|
return BitBlt_PATCOPY_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
|
|
|
|
|
|
|
|
case GDI_PATINVERT:
|
|
|
|
return BitBlt_PATINVERT_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
|
2015-03-10 14:53:31 +03:00
|
|
|
|
2011-07-01 00:17:55 +04:00
|
|
|
case GDI_DSTINVERT:
|
|
|
|
return BitBlt_DSTINVERT_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
|
|
|
|
|
|
|
|
case GDI_BLACKNESS:
|
|
|
|
return BitBlt_BLACKNESS_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
|
|
|
|
|
|
|
|
case GDI_WHITENESS:
|
|
|
|
return BitBlt_WHITENESS_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
|
2011-08-19 22:14:13 +04:00
|
|
|
|
2012-02-13 00:21:08 +04:00
|
|
|
case GDI_DPa:
|
|
|
|
return BitBlt_DPa_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
|
|
|
|
|
2011-08-19 22:14:13 +04:00
|
|
|
case GDI_PDxn:
|
|
|
|
return BitBlt_PDxn_16bpp(hdc, nXLeft, nYLeft, nWidth, nHeight);
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2014-09-12 16:36:29 +04:00
|
|
|
WLog_ERR(TAG, "PatBlt: unknown rop: 0x%08X", rop);
|
2015-06-26 15:32:38 +03:00
|
|
|
return FALSE;
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_BLACK_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = 0 */
|
|
|
|
*pixel = 0;
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_NOTMERGEPEN_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = ~(D | P) */
|
|
|
|
*pixel = ~(*pixel | *pen);
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_MASKNOTPEN_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = D & ~P */
|
|
|
|
*pixel &= ~(*pen);
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_NOTCOPYPEN_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = ~P */
|
|
|
|
*pixel = ~(*pen);
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_MASKPENNOT_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = P & ~D */
|
|
|
|
*pixel = *pen & ~*pixel;
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_NOT_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = ~D */
|
|
|
|
*pixel = ~(*pixel);
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_XORPEN_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = D ^ P */
|
|
|
|
*pixel = *pixel ^ *pen;
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_NOTMASKPEN_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = ~(D & P) */
|
|
|
|
*pixel = ~(*pixel & *pen);
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_MASKPEN_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = D & P */
|
|
|
|
*pixel &= *pen;
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_NOTXORPEN_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = ~(D ^ P) */
|
|
|
|
*pixel = ~(*pixel ^ *pen);
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_NOP_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = D */
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_MERGENOTPEN_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = D | ~P */
|
|
|
|
*pixel |= ~(*pen);
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_COPYPEN_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = P */
|
|
|
|
*pixel = *pen;
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_MERGEPENNOT_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = P | ~D */
|
|
|
|
*pixel = *pen | ~(*pixel);
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_MERGEPEN_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = P | D */
|
|
|
|
*pixel |= *pen;
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
static INLINE void SetPixel_WHITE_16bpp(UINT16 *pixel, UINT16 *pen)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
|
|
|
/* D = 1 */
|
|
|
|
*pixel = 0xFFFF;
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:01:37 +04:00
|
|
|
#define PIXEL_TYPE UINT16
|
2012-02-09 07:34:37 +04:00
|
|
|
#define GDI_GET_POINTER gdi_GetPointer_16bpp
|
|
|
|
#define GDI_GET_PEN_COLOR gdi_GetPenColor_16bpp
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_BLACK_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_BLACK_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_NOTMERGEPEN_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_NOTMERGEPEN_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_MASKNOTPEN_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_MASKNOTPEN_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_NOTCOPYPEN_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_NOTCOPYPEN_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_MASKPENNOT_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_MASKPENNOT_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_NOT_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_NOT_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_XORPEN_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_XORPEN_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_NOTMASKPEN_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_NOTMASKPEN_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_MASKPEN_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_MASKPEN_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_NOTXORPEN_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_NOTXORPEN_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_NOP_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_NOP_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_MERGENOTPEN_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_MERGENOTPEN_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_COPYPEN_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_COPYPEN_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_MERGEPENNOT_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_MERGEPENNOT_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_MERGEPEN_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_MERGEPEN_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#define LINE_TO LineTo_WHITE_16bpp
|
|
|
|
#define SET_PIXEL_ROP2 SetPixel_WHITE_16bpp
|
|
|
|
#include "include/line.c"
|
|
|
|
#undef LINE_TO
|
|
|
|
#undef SET_PIXEL_ROP2
|
|
|
|
|
|
|
|
#undef PIXEL_TYPE
|
|
|
|
#undef GDI_GET_POINTER
|
|
|
|
#undef GDI_GET_PEN_COLOR
|
|
|
|
|
|
|
|
pLineTo_16bpp LineTo_ROP2_16bpp[32] =
|
|
|
|
{
|
|
|
|
LineTo_BLACK_16bpp,
|
|
|
|
LineTo_NOTMERGEPEN_16bpp,
|
|
|
|
LineTo_MASKNOTPEN_16bpp,
|
|
|
|
LineTo_NOTCOPYPEN_16bpp,
|
|
|
|
LineTo_MASKPENNOT_16bpp,
|
|
|
|
LineTo_NOT_16bpp,
|
|
|
|
LineTo_XORPEN_16bpp,
|
|
|
|
LineTo_NOTMASKPEN_16bpp,
|
|
|
|
LineTo_MASKPEN_16bpp,
|
|
|
|
LineTo_NOTXORPEN_16bpp,
|
|
|
|
LineTo_NOP_16bpp,
|
|
|
|
LineTo_MERGENOTPEN_16bpp,
|
|
|
|
LineTo_COPYPEN_16bpp,
|
|
|
|
LineTo_MERGEPENNOT_16bpp,
|
|
|
|
LineTo_MERGEPEN_16bpp,
|
|
|
|
LineTo_WHITE_16bpp
|
2011-07-01 00:17:55 +04:00
|
|
|
};
|
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
BOOL LineTo_16bpp(HGDI_DC hdc, int nXEnd, int nYEnd)
|
2011-07-01 00:17:55 +04:00
|
|
|
{
|
2012-02-09 07:34:37 +04:00
|
|
|
pLineTo_16bpp _LineTo;
|
|
|
|
int rop2 = gdi_GetROP2(hdc) - 1;
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2012-02-09 07:34:37 +04:00
|
|
|
_LineTo = LineTo_ROP2_16bpp[rop2];
|
2011-07-01 00:17:55 +04:00
|
|
|
|
2015-06-26 15:32:38 +03:00
|
|
|
if (_LineTo == NULL)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return _LineTo(hdc, nXEnd, nYEnd);
|
2011-07-01 00:17:55 +04:00
|
|
|
}
|