mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-28 16:29:56 +00:00
dcc: Move some structure definition to use more RedPipeItemNum
Users of structures needs enumeration definitions too. Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Acked-by: Julien Ropé <jrope@gmail.com>
This commit is contained in:
parent
f4bc555b62
commit
228db683ba
@ -74,8 +74,7 @@ RedSurfaceCreateItem::RedSurfaceCreateItem(uint32_t surface_id,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t format,
|
||||
uint32_t flags):
|
||||
RedPipeItem(RED_PIPE_ITEM_TYPE_CREATE_SURFACE)
|
||||
uint32_t flags)
|
||||
{
|
||||
surface_create.surface_id = surface_id;
|
||||
surface_create.width = width;
|
||||
@ -188,11 +187,6 @@ void dcc_create_surface(DisplayChannelClient *dcc, int surface_id)
|
||||
dcc->pipe_add(std::move(create));
|
||||
}
|
||||
|
||||
RedImageItem::RedImageItem():
|
||||
RedPipeItem(RED_PIPE_ITEM_TYPE_IMAGE)
|
||||
{
|
||||
}
|
||||
|
||||
// adding the pipe item after pos. If pos == NULL, adding to head.
|
||||
void
|
||||
dcc_add_surface_area_image(DisplayChannelClient *dcc, int surface_id,
|
||||
@ -303,7 +297,6 @@ static void add_drawable_surface_images(DisplayChannelClient *dcc, Drawable *dra
|
||||
}
|
||||
|
||||
RedDrawablePipeItem::RedDrawablePipeItem(DisplayChannelClient *init_dcc, Drawable *init_drawable):
|
||||
RedPipeItem(RED_PIPE_ITEM_TYPE_DRAW),
|
||||
drawable(init_drawable),
|
||||
dcc(init_dcc)
|
||||
{
|
||||
@ -529,7 +522,7 @@ RedPipeItemPtr dcc_gl_scanout_item_new(RedChannelClient *rcc, void *data, int nu
|
||||
return RedPipeItemPtr();
|
||||
}
|
||||
|
||||
return red::make_shared<RedGlScanoutUnixItem>(RED_PIPE_ITEM_TYPE_GL_SCANOUT);
|
||||
return red::make_shared<RedGlScanoutUnixItem>();
|
||||
}
|
||||
|
||||
XXX_CAST(RedChannelClient, DisplayChannelClient, DISPLAY_CHANNEL_CLIENT);
|
||||
@ -548,7 +541,7 @@ RedPipeItemPtr dcc_gl_draw_item_new(RedChannelClient *rcc, void *data, int num)
|
||||
}
|
||||
|
||||
dcc->priv->gl_draw_ongoing = TRUE;
|
||||
auto item = red::make_shared<RedGlDrawItem>(RED_PIPE_ITEM_TYPE_GL_DRAW);
|
||||
auto item = red::make_shared<RedGlDrawItem>();
|
||||
item->draw = *draw;
|
||||
|
||||
return item;
|
||||
|
||||
39
server/dcc.h
39
server/dcc.h
@ -96,45 +96,6 @@ typedef struct FreeList {
|
||||
|
||||
#define DCC_TO_DC(dcc) ((DisplayChannel*) dcc->get_channel())
|
||||
|
||||
struct RedSurfaceCreateItem: public RedPipeItem {
|
||||
RedSurfaceCreateItem(uint32_t surface_id,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t format,
|
||||
uint32_t flags);
|
||||
SpiceMsgSurfaceCreate surface_create;
|
||||
};
|
||||
|
||||
struct RedGlScanoutUnixItem: public RedPipeItem {
|
||||
using RedPipeItem::RedPipeItem;
|
||||
};
|
||||
|
||||
struct RedGlDrawItem: public RedPipeItem {
|
||||
using RedPipeItem::RedPipeItem;
|
||||
SpiceMsgDisplayGlDraw draw;
|
||||
};
|
||||
|
||||
struct RedImageItem final: public RedPipeItem {
|
||||
RedImageItem();
|
||||
SpicePoint pos;
|
||||
int width;
|
||||
int height;
|
||||
int stride;
|
||||
int top_down;
|
||||
int surface_id;
|
||||
int image_format;
|
||||
uint32_t image_flags;
|
||||
int can_lossy;
|
||||
uint8_t data[0];
|
||||
};
|
||||
|
||||
struct RedDrawablePipeItem: public RedPipeItem {
|
||||
RedDrawablePipeItem(DisplayChannelClient *dcc, Drawable *drawable);
|
||||
~RedDrawablePipeItem();
|
||||
Drawable *const drawable;
|
||||
DisplayChannelClient *const dcc;
|
||||
};
|
||||
|
||||
DisplayChannelClient* dcc_new (DisplayChannel *display,
|
||||
RedClient *client,
|
||||
RedStream *stream,
|
||||
|
||||
@ -187,6 +187,42 @@ struct RedSurfaceDestroyItem: public RedPipeItemNum<RED_PIPE_ITEM_TYPE_DESTROY_S
|
||||
SpiceMsgSurfaceDestroy surface_destroy;
|
||||
};
|
||||
|
||||
struct RedSurfaceCreateItem: public RedPipeItemNum<RED_PIPE_ITEM_TYPE_CREATE_SURFACE> {
|
||||
RedSurfaceCreateItem(uint32_t surface_id,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t format,
|
||||
uint32_t flags);
|
||||
SpiceMsgSurfaceCreate surface_create;
|
||||
};
|
||||
|
||||
struct RedGlScanoutUnixItem: public RedPipeItemNum<RED_PIPE_ITEM_TYPE_GL_SCANOUT> {
|
||||
};
|
||||
|
||||
struct RedGlDrawItem: public RedPipeItemNum<RED_PIPE_ITEM_TYPE_GL_DRAW> {
|
||||
SpiceMsgDisplayGlDraw draw;
|
||||
};
|
||||
|
||||
struct RedImageItem final: public RedPipeItemNum<RED_PIPE_ITEM_TYPE_IMAGE> {
|
||||
SpicePoint pos;
|
||||
int width;
|
||||
int height;
|
||||
int stride;
|
||||
int top_down;
|
||||
int surface_id;
|
||||
int image_format;
|
||||
uint32_t image_flags;
|
||||
int can_lossy;
|
||||
uint8_t data[0];
|
||||
};
|
||||
|
||||
struct RedDrawablePipeItem: public RedPipeItemNum<RED_PIPE_ITEM_TYPE_DRAW> {
|
||||
RedDrawablePipeItem(DisplayChannelClient *dcc, Drawable *drawable);
|
||||
~RedDrawablePipeItem();
|
||||
Drawable *const drawable;
|
||||
DisplayChannelClient *const dcc;
|
||||
};
|
||||
|
||||
static inline int is_equal_path(SpicePath *path1, SpicePath *path2)
|
||||
{
|
||||
SpicePathSeg *seg1, *seg2;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user