[Spice-devel] Weird code

Christophe Fergeau cfergeau at redhat.com
Thu May 21 09:45:45 PDT 2015


Hey,

On Wed, May 06, 2015 at 10:21:45AM -0400, Frediano Ziglio wrote:
> Hi,
>   I was looking at spice-server code and I came into this piece of code
> 
>        /* drawable was already rendered, we may not be able to retrieve the lossless data
>            for the lossy areas */
>         sync_rendered = TRUE;
> 
>         // checking if the drawable itself or one of the other commands
>         // that were rendered, affected the areas that need to be resent

Looking at that comment and at the function calls below, maybe
sync_rendered should be set to FALSE at the beginning of this block
(after the "drawable was already rendered, we may not be able ..."
comment).

>         if (!drawable_intersects_with_areas(item, deps_surfaces_ids,
>                                             deps_areas, num_deps)) {
>             if (pipe_rendered_drawables_intersect_with_areas(worker, dcc,
>                                                              deps_surfaces_ids,
>                                                              deps_areas,
>                                                              num_deps)) {
>                 sync_rendered = TRUE;

This case seems to be "one of the other commands that were rendered affected the areas that need
to be resent"

>             }
>         } else {
>             sync_rendered = TRUE;

This case seems to be "the drawable itself affected the areas that need
to be resent"

Maybe we only want to do "sync_rendered = TRUE" when either of this
condition is TRUE. But I honestly don't know this code.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150521/5e894d7d/attachment-0001.sig>


More information about the Spice-devel mailing list