offscreen bitmaps: implement the delete list

ulab-next
Jay Sorg 12 years ago
parent e09f14e6d4
commit 900a2541ca

@ -758,12 +758,12 @@ libxrdp_orders_send_brush(struct xrdp_session* session,
/*****************************************************************************/ /*****************************************************************************/
int EXPORT_CC int EXPORT_CC
libxrdp_orders_send_create_os_surface(struct xrdp_session* session, int id, libxrdp_orders_send_create_os_surface(struct xrdp_session* session, int id,
int width, int height, int num_del_list, int width, int height,
int* del_list) struct list* del_list)
{ {
return xrdp_orders_send_create_os_surface return xrdp_orders_send_create_os_surface
((struct xrdp_orders*)(session->orders), id, width, height, ((struct xrdp_orders*)(session->orders), id,
num_del_list, del_list); width, height, del_list);
} }
/*****************************************************************************/ /*****************************************************************************/

@ -389,8 +389,8 @@ xrdp_orders_send_brush(struct xrdp_orders* self, int width, int height,
int bpp, int type, int size, char* data, int cache_id); int bpp, int type, int size, char* data, int cache_id);
int APP_CC int APP_CC
xrdp_orders_send_create_os_surface(struct xrdp_orders* self, int id, xrdp_orders_send_create_os_surface(struct xrdp_orders* self, int id,
int width, int height, int num_del_list, int width, int height,
int* del_list); struct list* del_list);
int APP_CC int APP_CC
xrdp_orders_send_switch_os_surface(struct xrdp_orders* self, int id); xrdp_orders_send_switch_os_surface(struct xrdp_orders* self, int id);

@ -178,8 +178,8 @@ libxrdp_orders_send_brush(struct xrdp_session* session,
int size, char* data, int cache_id); int size, char* data, int cache_id);
int EXPORT_CC int EXPORT_CC
libxrdp_orders_send_create_os_surface(struct xrdp_session* session, int id, libxrdp_orders_send_create_os_surface(struct xrdp_session* session, int id,
int width, int height, int num_del_list, int width, int height,
int* del_list); struct list* del_list);
int EXPORT_CC int EXPORT_CC
libxrdp_orders_send_switch_os_surface(struct xrdp_session* session, int id); libxrdp_orders_send_switch_os_surface(struct xrdp_session* session, int id);

@ -1975,16 +1975,19 @@ xrdp_orders_send_brush(struct xrdp_orders* self, int width, int height,
/* send an off screen bitmap entry */ /* send an off screen bitmap entry */
int APP_CC int APP_CC
xrdp_orders_send_create_os_surface(struct xrdp_orders* self, int id, xrdp_orders_send_create_os_surface(struct xrdp_orders* self, int id,
int width, int height, int num_del_list, int width, int height,
int* del_list) struct list* del_list)
{ {
int order_flags; int order_flags;
int cache_id; int cache_id;
int flags; int flags;
int index; int index;
int bytes; int bytes;
int num_del_list;
bytes = 7; bytes = 7;
num_del_list = del_list->count;
g_writeln("xrdp_orders_send_create_os_surface: num_del_list %d", num_del_list);
if (num_del_list > 0) if (num_del_list > 0)
{ {
bytes += 2; bytes += 2;
@ -2010,7 +2013,7 @@ xrdp_orders_send_create_os_surface(struct xrdp_orders* self, int id,
out_uint16_le(self->out_s, num_del_list); out_uint16_le(self->out_s, num_del_list);
for (index = 0; index < num_del_list; index++) for (index = 0; index < num_del_list; index++)
{ {
cache_id = del_list[index] & 0x7fff; cache_id = list_get_item(del_list, index) & 0x7fff;
out_uint16_le(self->out_s, cache_id); out_uint16_le(self->out_s, cache_id);
} }
} }

@ -27,6 +27,7 @@
#include "arch.h" #include "arch.h"
#include "parse.h" #include "parse.h"
#include "trans.h" #include "trans.h"
#include "list.h"
#include "libxrdpinc.h" #include "libxrdpinc.h"
#include "xrdp_types.h" #include "xrdp_types.h"
#include "xrdp_constants.h" #include "xrdp_constants.h"
@ -34,7 +35,6 @@
#include "os_calls.h" #include "os_calls.h"
#include "ssl_calls.h" #include "ssl_calls.h"
#include "thread_calls.h" #include "thread_calls.h"
#include "list.h"
#include "file.h" #include "file.h"
#include "file_loc.h" #include "file_loc.h"
#include "xrdp_client_info.h" #include "xrdp_client_info.h"

@ -43,6 +43,7 @@ xrdp_cache_create(struct xrdp_wm* owner,
self->bitmap_cache_persist_enable = client_info->bitmap_cache_persist_enable; self->bitmap_cache_persist_enable = client_info->bitmap_cache_persist_enable;
self->bitmap_cache_version = client_info->bitmap_cache_version; self->bitmap_cache_version = client_info->bitmap_cache_version;
self->pointer_cache_entries = client_info->pointer_cache_entries; self->pointer_cache_entries = client_info->pointer_cache_entries;
self->xrdp_os_del_list = list_create();
return self; return self;
} }
@ -78,6 +79,7 @@ xrdp_cache_delete(struct xrdp_cache* self)
{ {
xrdp_bitmap_delete(self->os_bitmap_items[i].bitmap); xrdp_bitmap_delete(self->os_bitmap_items[i].bitmap);
} }
list_delete(self->xrdp_os_del_list);
g_free(self); g_free(self);
} }
@ -564,12 +566,21 @@ int APP_CC
xrdp_cache_remove_os_bitmap(struct xrdp_cache* self, int rdpindex) xrdp_cache_remove_os_bitmap(struct xrdp_cache* self, int rdpindex)
{ {
struct xrdp_os_bitmap_item* bi; struct xrdp_os_bitmap_item* bi;
int index;
if ((rdpindex < 0) || (rdpindex >= 2000)) if ((rdpindex < 0) || (rdpindex >= 2000))
{ {
return 1; return 1;
} }
bi = self->os_bitmap_items + rdpindex; bi = self->os_bitmap_items + rdpindex;
if (bi->bitmap->tab_stop)
{
index = list_index_of(self->xrdp_os_del_list, rdpindex);
if (index == -1)
{
list_add_item(self->xrdp_os_del_list, rdpindex);
}
}
xrdp_bitmap_delete(bi->bitmap); xrdp_bitmap_delete(bi->bitmap);
g_memset(bi, 0, sizeof(struct xrdp_os_bitmap_item)); g_memset(bi, 0, sizeof(struct xrdp_os_bitmap_item));
return 0; return 0;

@ -52,6 +52,8 @@ int APP_CC
wm_painter_set_target(struct xrdp_painter* self) wm_painter_set_target(struct xrdp_painter* self)
{ {
int surface_index; int surface_index;
int index;
struct list* del_list;
if (self->wm->target_surface->type == WND_TYPE_SCREEN) if (self->wm->target_surface->type == WND_TYPE_SCREEN)
{ {
@ -68,10 +70,15 @@ wm_painter_set_target(struct xrdp_painter* self)
{ {
if (self->wm->target_surface->tab_stop == 0) /* tab_stop is hack */ if (self->wm->target_surface->tab_stop == 0) /* tab_stop is hack */
{ {
del_list = self->wm->cache->xrdp_os_del_list;
index = list_index_of(del_list, surface_index);
list_remove_item(del_list, index);
libxrdp_orders_send_create_os_surface(self->session, surface_index, libxrdp_orders_send_create_os_surface(self->session, surface_index,
self->wm->target_surface->width, self->wm->target_surface->width,
self->wm->target_surface->height, 0, 0); self->wm->target_surface->height,
del_list);
self->wm->target_surface->tab_stop = 1; self->wm->target_surface->tab_stop = 1;
list_clear(del_list);
} }
libxrdp_orders_send_switch_os_surface(self->session, surface_index); libxrdp_orders_send_switch_os_surface(self->session, surface_index);
self->wm->current_surface_index = surface_index; self->wm->current_surface_index = surface_index;

@ -184,6 +184,7 @@ struct xrdp_cache
int brush_stamp; int brush_stamp;
struct xrdp_brush_item brush_items[64]; struct xrdp_brush_item brush_items[64];
struct xrdp_os_bitmap_item os_bitmap_items[2000]; struct xrdp_os_bitmap_item os_bitmap_items[2000];
struct list* xrdp_os_del_list;
}; };
struct xrdp_mm struct xrdp_mm

Loading…
Cancel
Save