mirror of https://github.com/FreeRDP/FreeRDP
libfreerdp-gdi: merge fix from ngraziano for offscreen cache handling
This commit is contained in:
commit
2121a4a5cc
|
@ -202,16 +202,17 @@ Pixmap xf_bitmap_new(xfInfo* xfi, int width, int height, int bpp, uint8* data)
|
|||
|
||||
bitmap = XCreatePixmap(xfi->display, xfi->drawable, width, height, xfi->depth);
|
||||
|
||||
cdata = freerdp_image_convert(data, NULL, width, height, bpp, xfi->bpp, xfi->clrconv);
|
||||
if(data != NULL)
|
||||
{
|
||||
cdata = freerdp_image_convert(data, NULL, width, height, bpp, xfi->bpp, xfi->clrconv);
|
||||
image = XCreateImage(xfi->display, xfi->visual, xfi->depth,
|
||||
ZPixmap, 0, (char*) cdata, width, height, xfi->scanline_pad, 0);
|
||||
|
||||
image = XCreateImage(xfi->display, xfi->visual, xfi->depth,
|
||||
ZPixmap, 0, (char*) cdata, width, height, xfi->scanline_pad, 0);
|
||||
|
||||
XPutImage(xfi->display, bitmap, xfi->gc, image, 0, 0, 0, 0, width, height);
|
||||
XFree(image);
|
||||
|
||||
if (cdata != data)
|
||||
xfree(cdata);
|
||||
XPutImage(xfi->display, bitmap, xfi->gc, image, 0, 0, 0, 0, width, height);
|
||||
XFree(image);
|
||||
if (cdata != data)
|
||||
xfree(cdata);
|
||||
}
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
|
@ -616,7 +617,12 @@ void xf_gdi_memblt(rdpUpdate* update, MEMBLT_ORDER* memblt)
|
|||
xfInfo* xfi = GET_XFI(update);
|
||||
|
||||
xf_set_rop3(xfi, gdi_rop3_code(memblt->bRop));
|
||||
bitmap_cache_get(xfi->cache->bitmap, memblt->cacheId, memblt->cacheIndex, (void**) &extra);
|
||||
|
||||
if(memblt->cacheId == 0xFF)
|
||||
extra = offscreen_cache_get(xfi->cache->offscreen, memblt->cacheIndex);
|
||||
else
|
||||
bitmap_cache_get(xfi->cache->bitmap, memblt->cacheId, memblt->cacheIndex, (void**) &extra);
|
||||
|
||||
bitmap = (Pixmap) extra;
|
||||
|
||||
if (extra == NULL)
|
||||
|
|
|
@ -165,7 +165,7 @@ void rdp_write_client_persistent_key_list_pdu(STREAM* s, rdpSettings* settings)
|
|||
stream_write_uint16(s, 0); /* totalEntriesCache2 (2 bytes) */
|
||||
stream_write_uint16(s, 0); /* totalEntriesCache3 (2 bytes) */
|
||||
stream_write_uint16(s, 0); /* totalEntriesCache4 (2 bytes) */
|
||||
stream_write_uint8(s, PERSIST_LAST_PDU); /* bBitMask (1 byte) */
|
||||
stream_write_uint8(s, PERSIST_FIRST_PDU | PERSIST_LAST_PDU); /* bBitMask (1 byte) */
|
||||
stream_write_uint8(s, 0); /* pad1 (1 byte) */
|
||||
stream_write_uint16(s, 0); /* pad3 (2 bytes) */
|
||||
|
||||
|
|
|
@ -651,7 +651,11 @@ void gdi_memblt(rdpUpdate* update, MEMBLT_ORDER* memblt)
|
|||
GDI_IMAGE* gdi_bmp;
|
||||
GDI* gdi = GET_GDI(update);
|
||||
|
||||
bitmap_cache_get(gdi->cache->bitmap, memblt->cacheId, memblt->cacheIndex, (void**) &extra);
|
||||
if(memblt->cacheId == 0xFF)
|
||||
extra = offscreen_cache_get(gdi->cache->offscreen, memblt->cacheIndex);
|
||||
else
|
||||
bitmap_cache_get(gdi->cache->bitmap, memblt->cacheId, memblt->cacheIndex, (void**) &extra);
|
||||
|
||||
gdi_bmp = (GDI_IMAGE*) extra;
|
||||
|
||||
if (extra == NULL)
|
||||
|
|
Loading…
Reference in New Issue