diff options
author | Jonathon Jongsma <jjongsma@redhat.com> | 2015-03-12 15:12:44 -0500 |
---|---|---|
committer | Jonathon Jongsma <jjongsma@redhat.com> | 2016-05-12 14:08:06 -0500 |
commit | 634fe8c368e67e8234e8a166e5affe3e8723d401 (patch) | |
tree | 3f6b77f80f7f15e5edc1e6c03adefb05da66b12b /server/display-channel.c | |
parent | d2a62dad14176471a6ab169561f3660abc506b44 (diff) |
Limit direct access to DisplayChannelClientreview-20160512review
Add a few more methods and accessors so that other files don't need to
manipulate the struct members directly. Move the struct definition to a
private header which only the dcc-* files will include.
Diffstat (limited to 'server/display-channel.c')
-rw-r--r-- | server/display-channel.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/server/display-channel.c b/server/display-channel.c index 25d7a5be..c3b85646 100644 --- a/server/display-channel.c +++ b/server/display-channel.c @@ -312,7 +312,7 @@ static void streams_update_visible_region(DisplayChannel *display, Drawable *dra } FOREACH_DCC(display, link, next, dcc) { - agent = &dcc->stream_agents[get_stream_id(display, stream)]; + agent = dcc_get_stream_agent(dcc, get_stream_id(display, stream)); if (region_intersects(&agent->vis_region, &drawable->tree_item.base.rgn)) { region_exclude(&agent->vis_region, &drawable->tree_item.base.rgn); @@ -1302,7 +1302,7 @@ void display_channel_free_some(DisplayChannel *display) spice_debug("#draw=%d, #glz_draw=%d", display->drawable_count, display->glz_drawable_count); FOREACH_DCC(display, link, next, dcc) { - GlzSharedDictionary *glz_dict = dcc ? dcc->glz_dict : NULL; + GlzSharedDictionary *glz_dict = dcc_get_glz_dictionary(dcc); if (glz_dict) { // encoding using the dictionary is prevented since the following operations might @@ -1317,7 +1317,7 @@ void display_channel_free_some(DisplayChannel *display) } FOREACH_DCC(display, link, next, dcc) { - GlzSharedDictionary *glz_dict = dcc ? dcc->glz_dict : NULL; + GlzSharedDictionary *glz_dict = dcc_get_glz_dictionary(dcc); if (glz_dict) { pthread_rwlock_unlock(&glz_dict->encode_lock); @@ -2128,16 +2128,16 @@ void display_channel_process_surface_cmd(DisplayChannel *display, RedSurfaceCmd void display_channel_update_compression(DisplayChannel *display, DisplayChannelClient *dcc) { - if (dcc->jpeg_state == SPICE_WAN_COMPRESSION_AUTO) { - display->enable_jpeg = dcc->common.is_low_bandwidth; + if (dcc_get_jpeg_state(dcc) == SPICE_WAN_COMPRESSION_AUTO) { + display->enable_jpeg = ((CommonGraphicsChannelClient*)dcc)->is_low_bandwidth; } else { - display->enable_jpeg = (dcc->jpeg_state == SPICE_WAN_COMPRESSION_ALWAYS); + display->enable_jpeg = (dcc_get_jpeg_state(dcc) == SPICE_WAN_COMPRESSION_ALWAYS); } - if (dcc->zlib_glz_state == SPICE_WAN_COMPRESSION_AUTO) { - display->enable_zlib_glz_wrap = dcc->common.is_low_bandwidth; + if (dcc_get_zlib_glz_state(dcc) == SPICE_WAN_COMPRESSION_AUTO) { + display->enable_zlib_glz_wrap = ((CommonGraphicsChannelClient*)dcc)->is_low_bandwidth; } else { - display->enable_zlib_glz_wrap = (dcc->zlib_glz_state == SPICE_WAN_COMPRESSION_ALWAYS); + display->enable_zlib_glz_wrap = (dcc_get_zlib_glz_state(dcc) == SPICE_WAN_COMPRESSION_ALWAYS); } spice_info("jpeg %s", display->enable_jpeg ? "enabled" : "disabled"); spice_info("zlib-over-glz %s", display->enable_zlib_glz_wrap ? "enabled" : "disabled"); |