From: Marc-André Moreau Date: Sun, 8 Jan 2012 22:43:07 +0000 (-0500) Subject: libfreerdp-gdi: fix 16bpp glyph drawing X-Git-Tag: 1.0.0~33^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb2c9969e8b70cca4ad1f6cdb21e9869966fad89;p=platform%2Fupstream%2Ffreerdp.git libfreerdp-gdi: fix 16bpp glyph drawing --- diff --git a/libfreerdp-gdi/16bpp.c b/libfreerdp-gdi/16bpp.c index 2d670eb..44c121c 100644 --- a/libfreerdp-gdi/16bpp.c +++ b/libfreerdp-gdi/16bpp.c @@ -368,9 +368,9 @@ static int BitBlt_SRCPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nW static int BitBlt_DSPDxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc) { int x, y; - uint16* srcp; + uint8* srcp; uint16* dstp; - uint16* patp; + uint16 src16; uint16 color16; HGDI_BITMAP hSrcBmp; @@ -380,7 +380,6 @@ static int BitBlt_DSPDxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWi color16 = gdi_get_color_16bpp(hdcDest, hdcDest->textColor); hSrcBmp = (HGDI_BITMAP) hdcSrc->selectedObject; - srcp = (uint16*) hSrcBmp->data; if (hdcSrc->bytesPerPixel != 1) { @@ -390,15 +389,15 @@ static int BitBlt_DSPDxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWi for (y = 0; y < nHeight; y++) { - srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y); + srcp = (uint8*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y); dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y); if (dstp != 0) { for (x = 0; x < nWidth; x++) { - patp = (uint16*) &color16; - *dstp = (*srcp & *patp) | (~(*srcp) & *dstp); + src16 = (*srcp << 8) | *srcp; + *dstp = (src16 & color16) | (~src16 & *dstp); srcp++; dstp++; }