summaryrefslogtreecommitdiff
path: root/server/display-channel.c
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2016-02-11 12:37:20 +0000
committerFrediano Ziglio <fziglio@redhat.com>2016-02-11 19:12:53 +0000
commit5c1d744d85fafbba228e545e1f61ba78f85f2446 (patch)
tree07a8c8119658ef9294d0f918315150f87b8439eb /server/display-channel.c
parent127e3ad19160f0c4248dfa49ed697ce652c60834 (diff)
Store 'renderers' as GArray in RedsState
Acked-by: Jonathon Jongsma <jjongsma@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
Diffstat (limited to 'server/display-channel.c')
-rw-r--r--server/display-channel.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/server/display-channel.c b/server/display-channel.c
index b4f7ede4..78c984fd 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -1911,10 +1911,12 @@ void display_channel_create_surface(DisplayChannel *display, uint32_t surface_id
if (display->renderer == RED_RENDERER_INVALID) {
int i;
- for (i = 0; i < display->num_renderers; i++) {
- surface->context.canvas = create_canvas_for_surface(display, surface, display->renderers[i]);
+ GArray *renderers = reds_get_renderers(reds);
+ for (i = 0; i < renderers->len; i++) {
+ uint32_t renderer = g_array_index(renderers, uint32_t, i);
+ surface->context.canvas = create_canvas_for_surface(display, surface, renderer);
if (surface->context.canvas) {
- display->renderer = display->renderers[i];
+ display->renderer = renderer;
break;
}
}
@@ -2031,8 +2033,6 @@ DisplayChannel* display_channel_new(RedWorker *worker, int migrate, int stream_v
image_surfaces_get,
};
- spice_return_val_if_fail(num_renderers > 0, NULL);
-
spice_info("create display channel");
display = (DisplayChannel *)red_worker_new_channel(
worker, sizeof(*display), "display_channel",
@@ -2063,8 +2063,6 @@ DisplayChannel* display_channel_new(RedWorker *worker, int migrate, int stream_v
stat_compress_init(&display->lz4_stat, "lz4", stat_clock);
display->n_surfaces = n_surfaces;
- display->num_renderers = num_renderers;
- memcpy(display->renderers, renderers, sizeof(display->renderers));
display->renderer = RED_RENDERER_INVALID;
ring_init(&display->current_list);