[Spice-devel] Weird code

Frediano Ziglio fziglio at redhat.com
Wed May 6 07:21:45 PDT 2015


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
        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;
            }
        } else {
            sync_rendered = TRUE;
        }

(in red_add_lossless_drawable_dependencies function, red_worker.c)

Now sync_rendered after this code is always TRUE from first assignment (no pointer taken between all assignments), also the 2 functions (drawable_intersects_with_areas and pipe_rendered_drawables_intersect_with_areas) does only some checks on the parameters without changing them. So... This code is not equivalent (and faster) ?

       /* drawable was already rendered, we may not be able to retrieve the lossless data
           for the lossy areas */
        sync_rendered = TRUE;


Frediano


More information about the Spice-devel mailing list