common-graphics-channel: Use marshaller structure for RedCachePipeItem

Allows to simplify a bit marshalling code in both CursorChannel
and DisplayChannel as they use the same marshalling structure.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Julien Ropé <jrope@gmail.com>
This commit is contained in:
Frediano Ziglio 2020-06-09 04:03:48 +01:00
parent e7cdaa668d
commit dc65afb03a
4 changed files with 4 additions and 10 deletions

View File

@ -77,7 +77,7 @@ static void FUNC_NAME(remove)(CHANNELCLIENT *channel_client, RedCacheItem *item)
RedCachePipeItem *pipe_item = reinterpret_cast<RedCachePipeItem*>(item);
red_pipe_item_init(&pipe_item->base, RED_PIPE_ITEM_TYPE_INVAL_ONE);
pipe_item->id = id;
pipe_item->inval_one.id = id;
channel_client->pipe_add_tail(&pipe_item->base); // for now
}

View File

@ -71,7 +71,7 @@ protected:
/* pipe item used to release a specific cached item on the client */
struct RedCachePipeItem {
RedPipeItem base;
uint64_t id;
SpiceMsgDisplayInvalOne inval_one;
};
#include "pop-visibility.h"

View File

@ -168,12 +168,9 @@ static inline void red_marshall_inval(RedChannelClient *rcc,
SpiceMarshaller *base_marshaller,
RedCachePipeItem *cache_item)
{
SpiceMsgDisplayInvalOne inval_one;
rcc->init_send_data(SPICE_MSG_CURSOR_INVAL_ONE);
inval_one.id = cache_item->id;
spice_marshall_msg_cursor_inval_one(base_marshaller, &inval_one);
spice_marshall_msg_cursor_inval_one(base_marshaller, &cache_item->inval_one);
}
void CursorChannelClient::send_item(RedPipeItem *pipe_item)

View File

@ -1742,12 +1742,9 @@ static inline void marshall_inval_palette(RedChannelClient *rcc,
SpiceMarshaller *base_marshaller,
RedCachePipeItem *cache_item)
{
SpiceMsgDisplayInvalOne inval_one;
rcc->init_send_data(SPICE_MSG_DISPLAY_INVAL_PALETTE);
inval_one.id = cache_item->id;
spice_marshall_msg_display_inval_palette(base_marshaller, &inval_one);
spice_marshall_msg_display_inval_palette(base_marshaller, &cache_item->inval_one);
}