if (!bitmap)
return FALSE;
- if (!Bitmap_SetDimensions(bitmap, cacheBitmap->bitmapWidth,
- cacheBitmap->bitmapHeight))
- {
- bitmap->Free(context, bitmap);
- return FALSE;
- }
-
if (!bitmap->Decompress(context, bitmap,
cacheBitmap->bitmapDataStream, cacheBitmap->bitmapWidth,
cacheBitmap->bitmapHeight,
if (!bitmap)
return FALSE;
- Bitmap_SetDimensions(bitmap, cacheBitmapV2->bitmapWidth,
- cacheBitmapV2->bitmapHeight);
-
if (!cacheBitmapV2->bitmapBpp)
cacheBitmapV2->bitmapBpp = settings->ColorDepth;
if (!bitmap)
return FALSE;
- Bitmap_SetDimensions(bitmap, bitmapData->width, bitmapData->height);
-
if (!cacheBitmapV3->bpp)
cacheBitmapV3->bpp = settings->ColorDepth;
compressed = (bitmapData->codecID != RDP_CODEC_ID_NONE);
bitmap->Decompress(context, bitmap,
- bitmapData->data, bitmap->width, bitmap->height,
+ bitmapData->data, bitmapData->width, bitmapData->height,
bitmapData->bpp, bitmapData->length, compressed,
bitmapData->codecID);
Bitmap_SetRectangle(bitmap,
bitmapData->destLeft, bitmapData->destTop,
bitmapData->destRight, bitmapData->destBottom);
- Bitmap_SetDimensions(bitmap, bitmapData->width, bitmapData->height);
- bitmap->Decompress(context, bitmap,
- bitmapData->bitmapDataStream, bitmapData->width, bitmapData->height,
- bitmapData->bitsPerPixel, bitmapData->bitmapLength,
- bitmapData->compressed, RDP_CODEC_ID_NONE);
if (reused)
bitmap->Free(context, bitmap);
- reused = TRUE;
+ bitmap->Decompress(context, bitmap,
+ bitmapData->bitmapDataStream, bitmapData->width, bitmapData->height,
+ bitmapData->bitsPerPixel, bitmapData->bitmapLength,
+ bitmapData->compressed, RDP_CODEC_ID_NONE);
if (!bitmap->New(context, bitmap))
return FALSE;
if (!glyphData)
return FALSE;
- glyph = Glyph_Alloc(context);
+ glyph = Glyph_Alloc(context, x, y, glyphData->cx, glyphData->cy,
+ glyphData->cb, glyphData->aj);
if (!glyph)
return FALSE;
- glyph->x = x;
- glyph->y = y;
- glyph->cx = glyphData->cx;
- glyph->cy = glyphData->cy;
- glyph->cb = glyphData->cb;
- glyph->aj = malloc(glyphData->cb);
-
- if (!glyph->aj)
- {
- IFCALL(glyph->Free, context, glyph);
- return FALSE;
- }
-
- CopyMemory(glyph->aj, glyphData->aj, glyph->cb);
-
- if (!glyph->New(context, glyph))
- {
- IFCALL(glyph->Free, context, glyph);
- return FALSE;
- }
-
glyph_cache_put(cache->glyph, fastGlyph->cacheId, fastGlyph->data[0], glyph);
}
if (!glyph_data)
return FALSE;
- if (!(glyph = Glyph_Alloc(context)))
+ if (!(glyph = Glyph_Alloc(context, glyph_data->x,
+ glyph_data->y,
+ glyph_data->cx,
+ glyph_data->cy,
+ glyph_data->cb,
+ glyph_data->aj)))
return FALSE;
- glyph->x = glyph_data->x;
- glyph->y = glyph_data->y;
- glyph->cx = glyph_data->cx;
- glyph->cy = glyph_data->cy;
- glyph->cb = glyph_data->cb;
- glyph->aj = glyph_data->aj;
-
- if (!glyph->New(context, glyph))
- {
- glyph->Free(context, glyph);
- return FALSE;
- }
-
glyph_cache_put(cache->glyph, cacheGlyph->cacheId, glyph_data->cacheIndex,
glyph);
}
if (!glyphData)
return FALSE;
- glyph = Glyph_Alloc(context);
+ glyph = Glyph_Alloc(context, glyphData->x,
+ glyphData->y,
+ glyphData->cx,
+ glyphData->cy,
+ glyphData->cb,
+ glyphData->aj);
if (!glyph)
return FALSE;
- glyph->x = glyphData->x;
- glyph->y = glyphData->y;
- glyph->cx = glyphData->cx;
- glyph->cy = glyphData->cy;
- glyph->cb = glyphData->cb;
- glyph->aj = glyphData->aj;
-
- if (!glyph->New(context, glyph))
- {
- glyph->Free(context, glyph);
- return FALSE;
- }
-
glyph_cache_put(cache->glyph, cacheGlyphV2->cacheId, glyphData->cacheIndex,
glyph);
}
prevGlyph = glyphCache->glyphCache[id].entries[index];
if (prevGlyph)
- glyph->Free(glyphCache->context, prevGlyph);
+ prevGlyph->Free(glyphCache->context, prevGlyph);
glyphCache->glyphCache[id].entries[index] = glyph;
return TRUE;
#include <freerdp/gdi/region.h>
#include <freerdp/gdi/bitmap.h>
#include <freerdp/log.h>
+#include <freerdp/gdi/shape.h>
#include "brush.h"
#include "clipping.h"
if (!hDstBmp || !hSrcBmp)
return FALSE;
- if (!freerdp_image_copy(hDstBmp->data, hDstBmp->format, hDstBmp->scanline,
- nXDest, nYDest, nWidth, nHeight,
- hSrcBmp->data, hSrcBmp->format, hSrcBmp->scanline,
- nXSrc, nYSrc, palette))
- return FALSE;
-
- return TRUE;
+ return freerdp_image_copy(hDstBmp->data, hDstBmp->format, hDstBmp->scanline,
+ nXDest, nYDest, nWidth, nHeight,
+ hSrcBmp->data, hSrcBmp->format, hSrcBmp->scanline,
+ nXSrc, nYSrc, palette);
}
static BOOL BitBlt_NOTSRCCOPY(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
UINT32 color;
colorA = ConvertColor(colorA, hdcSrc->format, hdcDest->format,
palette);
- color = colorA & ~colorB;
+ color = ~colorA & colorB;
WriteColor(dstp, hdcDest->format, color);
}
}
if (srcp && dstp)
{
UINT32 color;
- UINT32 colorA = ReadColor(srcp, hdcSrc->format);
- UINT32 colorB = ReadColor(dstp, hdcDest->format);
- colorA = ConvertColor(colorA, hdcSrc->format,
+ UINT32 colorA = ReadColor(dstp, hdcDest->format);
+ UINT32 colorB = ReadColor(srcp, hdcSrc->format);
+ colorB = ConvertColor(colorB, hdcSrc->format,
hdcDest->format, palette);
- color = ~colorA & ~colorB;
+ color = ~(colorA | colorB);
WriteColor(dstp, hdcDest->format, color);
}
}
if (srcp && dstp)
{
UINT32 color;
- UINT32 colorA = ReadColor(srcp, hdcSrc->format);
- UINT32 colorB = ReadColor(dstp, hdcDest->format);
- colorA = ConvertColor(colorA, hdcSrc->format,
+ UINT32 colorA = ReadColor(dstp, hdcDest->format);
+ UINT32 colorB = ReadColor(srcp, hdcSrc->format);
+ colorB = ConvertColor(colorB, hdcSrc->format,
hdcDest->format, palette);
color = colorA ^ colorB;
WriteColor(dstp, hdcDest->format, color);
if (srcp && dstp)
{
UINT32 color;
- UINT32 colorA = ReadColor(srcp, hdcSrc->format);
- UINT32 colorB = ReadColor(dstp, hdcDest->format);
- colorA = ConvertColor(colorA, hdcSrc->format,
+ UINT32 colorA = ReadColor(dstp, hdcDest->format);
+ UINT32 colorB = ReadColor(srcp, hdcSrc->format);
+ colorB = ConvertColor(colorB, hdcSrc->format,
hdcDest->format, palette);
color = colorA & colorB;
WriteColor(dstp, hdcDest->format, color);
UINT32 nXSrc, UINT32 nYSrc, const gdiPalette* palette)
{
UINT32 x, y;
- UINT32 color;
+ UINT32 colorC;
if (!hdcDest || !hdcSrc)
return FALSE;
- /* D = (D ^ S) & (P ^ D) */
- color = hdcDest->textColor;
+ colorC = hdcDest->textColor;
for (y = 0; y < nHeight; y++)
{
if (srcp && dstp)
{
UINT32 dstColor;
- UINT32 colorA = ReadColor(srcp, hdcSrc->format);
- UINT32 colorB = ReadColor(dstp, hdcDest->format);
- colorA = ConvertColor(colorA, hdcSrc->format,
+ UINT32 tmp1, tmp2;
+ UINT32 colorA = ReadColor(dstp, hdcDest->format);
+ UINT32 colorB = ReadColor(srcp, hdcSrc->format);
+ colorB = ConvertColor(colorB, hdcSrc->format,
hdcDest->format, palette);
- dstColor = (colorB ^ colorA) & (color & colorB);
+ tmp1 = colorA ^ colorB;
+ tmp2 = tmp1 & colorC;
+ dstColor = tmp2 ^ colorA;
+ //dstColor = (colorA ^ colorB) & (colorC ^ colorA);
WriteColor(dstp, hdcDest->format, dstColor);
}
}
/* D = (S & D) | (~S & P) */
if (hdcDest->brush->style == GDI_BS_SOLID)
{
- UINT32 colorC = hdcDest->brush->color;
+ UINT32 colorA = hdcDest->brush->color;
for (y = 0; y < nHeight; y++)
{
if (srcp && dstp)
{
UINT32 color;
- UINT32 colorA = ReadColor(srcp, hdcSrc->format);
- UINT32 colorB = ReadColor(dstp, hdcDest->format);
- colorA = ConvertColor(colorA, hdcSrc->format,
+ UINT32 colorB = ReadColor(srcp, hdcSrc->format);
+ UINT32 colorC = ReadColor(dstp, hdcDest->format);
+ colorB = ConvertColor(colorB, hdcSrc->format,
hdcDest->format, palette);
- color = (colorA & colorB) | (~colorA & colorC);
+ color = ((colorA ^ colorB) & colorC) ^ colorA;
WriteColor(dstp, hdcDest->format, color);
}
}
if (srcp && dstp)
{
UINT32 color;
- UINT32 colorA = ReadColor(srcp, hdcSrc->format);
- UINT32 colorB = ReadColor(dstp, hdcDest->format);
- UINT32 colorC = ReadColor(patp, hdcDest->format);
+ UINT32 colorB = ReadColor(srcp, hdcSrc->format);
+ UINT32 colorC = ReadColor(dstp, hdcDest->format);
+ UINT32 colorA = ReadColor(patp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
hdcDest->format, palette);
- color = (colorA & colorB) | (~colorA & colorC);
+ color = ((colorA ^ colorB) & colorC) ^ colorA;
WriteColor(dstp, hdcDest->format, color);
}
}
/* D = S ^ (P & (D ^ S)) */
if (hdcDest->brush->style == GDI_BS_SOLID)
{
- UINT32 color = hdcDest->brush->color;
+ UINT32 colorB = hdcDest->brush->color;
for (y = 0; y < nHeight; y++)
{
if (srcp && dstp)
{
- UINT32 colorD;
+ UINT32 color;
UINT32 colorA = ReadColor(srcp, hdcSrc->format);
- UINT32 colorB = ReadColor(dstp, hdcDest->format);
+ UINT32 colorC = ReadColor(dstp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
hdcDest->format, palette);
- colorD = colorA ^ (color & (colorB ^ colorA));
+ color = ((colorA ^ colorB) & colorC) ^ colorA;
WriteColor(dstp, hdcDest->format, color);
}
}
if (srcp && dstp)
{
- UINT32 colorD;
+ UINT32 color;
UINT32 colorA = ReadColor(srcp, hdcSrc->format);
- UINT32 colorB = ReadColor(dstp, hdcDest->format);
- UINT32 color = ReadColor(patp, hdcDest->format);
+ UINT32 colorB = ReadColor(patp, hdcDest->format);
+ UINT32 colorC = ReadColor(dstp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
hdcDest->format, palette);
- colorD = colorA ^ (color & (colorB ^ colorA));
+ color = ((colorA ^ colorB) & colorC) ^ colorA;
WriteColor(dstp, hdcDest->format, color);
}
}
UINT32 colorB = ReadColor(patp, hdcDest->format);
colorB = ConvertColor(colorB, hdcDest->format,
hdcSrc->format, palette);
- color = colorA & ~colorB;
+ color = (~colorA) & colorB;
color = ConvertColor(color, hdcSrc->format, hdcDest->format, palette);
WriteColor(dstp, hdcDest->format, color);
}
UINT32 colorB = ReadColor(dstp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
hdcDest->format, palette);
- color = ~colorA & colorB;
+ color = colorA & (~colorB);
WriteColor(dstp, hdcDest->format, color);
}
}
UINT32 color;
colorA = ConvertColor(colorA, hdcSrc->format, hdcDest->format,
palette);
- color = ~colorA | colorB;
+ color = colorA | (~colorB);
WriteColor(dstp, hdcDest->format, color);
}
}