[Spice-devel] [PATCH 4/5] DisplayChannel: use proper function name conventions

Christophe Fergeau cfergeau at redhat.com
Thu Feb 16 14:17:25 UTC 2017


This one causes a build failure because there is already an
_add_drawable() method in display-channel.c, ie this is (badly) fixed by


diff --git a/server/display-channel.c b/server/display-channel.c
index 9f3d62e..cd1a6ef 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -1368,7 +1368,7 @@ static Drawable *display_channel_get_drawable(DisplayChannel *display, uint8_t e
  * Add a Drawable to the items to draw.
  * On failure the Drawable is not added.
  */
-static void display_channel_add_drawable(DisplayChannel *display, Drawable *drawable)
+static void display_channel_add_drawable_new(DisplayChannel *display, Drawable *drawable)
 {
     int surface_id = drawable->surface_id;
     RedDrawable *red_drawable = drawable->red_drawable;
@@ -1429,7 +1429,7 @@ void display_channel_process_draw(DisplayChannel *display, RedDrawable *red_draw
         return;
     }

-    display_channel_add_drawable(display, drawable);
+    display_channel_add_drawable_new(display, drawable);

     drawable_unref(drawable);
 }


On Fri, Feb 03, 2017 at 04:55:13PM -0600, Jonathon Jongsma wrote:
> Change current_add_drawable() to display_channel_add_drawable() and
> current_remove_drawable() to display_channel_remove_drawable().
> ---
>  server/display-channel.c | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/server/display-channel.c b/server/display-channel.c
> index e12751b..ed00740 100644
> --- a/server/display-channel.c
> +++ b/server/display-channel.c
> @@ -379,8 +379,8 @@ static void pipes_add_drawable_after(DisplayChannel *display,
>      }
>  }
>  
> -static void current_add_drawable(DisplayChannel *display,
> -                                 Drawable *drawable, RingItem *pos)
> +static void display_channel_add_drawable(DisplayChannel *display,
> +                                         Drawable *drawable, RingItem *pos)
>  {
>      RedSurface *surface;
>      uint32_t surface_id = drawable->surface_id;
> @@ -394,7 +394,7 @@ static void current_add_drawable(DisplayChannel *display,
>  
>  /* Unrefs the drawable and removes it from any rings that it's in, as well as
>   * removing any associated shadow item */
> -static void current_remove_drawable(DisplayChannel *display, Drawable *item)
> +static void display_channel_remove_drawable(DisplayChannel *display, Drawable *item)
>  {
>      /* todo: move all to unref? */
>      stream_trace_add_drawable(display, item);
> @@ -436,7 +436,7 @@ static void current_remove(DisplayChannel *display, TreeItem *item)
>              Drawable *drawable = SPICE_CONTAINEROF(now, Drawable, tree_item.base);
>              ring_item = now->siblings_link.prev;
>              drawable_remove_from_pipes(drawable);
> -            current_remove_drawable(display, drawable);
> +            display_channel_remove_drawable(display, drawable);
>          } else {
>              Container *now_as_container = CONTAINER(now);
>  
> @@ -523,9 +523,9 @@ static int current_add_equal(DisplayChannel *display, DrawItem *item, TreeItem *
>          int add_after = !!other_drawable->stream &&
>                          is_drawable_independent_from_surfaces(drawable);
>          stream_maintenance(display, drawable, other_drawable);
> -        current_add_drawable(display, drawable, &other->siblings_link);
> +        display_channel_add_drawable(display, drawable, &other->siblings_link);
>          other_drawable->refs++;
> -        current_remove_drawable(display, other_drawable);
> +        display_channel_remove_drawable(display, other_drawable);
>          if (add_after) {
>              pipes_add_drawable_after(display, drawable, other_drawable);
>          } else {
> @@ -545,7 +545,7 @@ static int current_add_equal(DisplayChannel *display, DrawItem *item, TreeItem *
>              GListIter iter;
>  
>              other_drawable->refs++;
> -            current_remove_drawable(display, other_drawable);
> +            display_channel_remove_drawable(display, other_drawable);
>  
>              /* sending the drawable to clients that already received
>               * (or will receive) other_drawable */
> @@ -567,9 +567,9 @@ static int current_add_equal(DisplayChannel *display, DrawItem *item, TreeItem *
>          break;
>      case QXL_EFFECT_OPAQUE_BRUSH:
>          if (is_same_geometry(drawable, other_drawable)) {
> -            current_add_drawable(display, drawable, &other->siblings_link);
> +            display_channel_add_drawable(display, drawable, &other->siblings_link);
>              drawable_remove_from_pipes(other_drawable);
> -            current_remove_drawable(display, other_drawable);
> +            display_channel_remove_drawable(display, other_drawable);
>              pipes_add_drawable(display, drawable);
>              return TRUE;
>          }
> @@ -744,7 +744,7 @@ static int current_add_with_shadow(DisplayChannel *display, Ring *ring, Drawable
>      /* Prepend the draw item to the beginning of the current ring. NOTE: this
>       * means that the drawable is placed *before* its associated shadow in the
>       * tree. Changing this order will violate several unstated assumptions */
> -    current_add_drawable(display, item, ring);
> +    display_channel_add_drawable(display, item, ring);
>      if (item->tree_item.effect == QXL_EFFECT_OPAQUE) {
>          QRegion exclude_rgn;
>          region_clone(&exclude_rgn, &item->tree_item.base.rgn);
> @@ -895,7 +895,7 @@ static int current_add(DisplayChannel *display, Ring *ring, Drawable *drawable)
>           * safety (todo: Not sure if exclude_region can affect the drawable
>           * if it is added to the tree before calling exclude_region).
>           */
> -        current_add_drawable(display, drawable, ring);
> +        display_channel_add_drawable(display, drawable, ring);
>      } else {
>          /*
>           * stream_detach_behind can affect the current tree since
> @@ -903,7 +903,7 @@ static int current_add(DisplayChannel *display, Ring *ring, Drawable *drawable)
>           * drawable should be added to the tree before calling
>           * stream_detach_behind
>           */
> -        current_add_drawable(display, drawable, ring);
> +        display_channel_add_drawable(display, drawable, ring);
>          if (is_primary_surface(display, drawable->surface_id)) {
>              stream_detach_behind(display, &drawable->tree_item.base.rgn, drawable);
>          }
> @@ -1351,7 +1351,7 @@ static bool free_one_drawable(DisplayChannel *display, int force_glz_free)
>      drawable_draw(display, drawable);
>      container = drawable->tree_item.base.container;
>  
> -    current_remove_drawable(display, drawable);
> +    display_channel_remove_drawable(display, drawable);
>      container_cleanup(container);
>      return TRUE;
>  }
> @@ -1707,7 +1707,7 @@ static void draw_until(DisplayChannel *display, RedSurface *surface, Drawable *l
>          now = SPICE_CONTAINEROF(ring_item, Drawable, surface_list_link);
>          now->refs++;
>          container = now->tree_item.base.container;
> -        current_remove_drawable(display, now);
> +        display_channel_remove_drawable(display, now);
>          container_cleanup(container);
>          /* drawable_draw may call display_channel_draw for the surfaces 'now' depends on. Notice,
>             that it is valid to call display_channel_draw in this case and not display_channel_draw_till:
> -- 
> 2.9.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170216/817ea670/attachment.sig>


More information about the Spice-devel mailing list