Re: Weird code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/06/2015 05:21 PM, 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
         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;

Indeed, that seems like a simpler equivalent code.
Perhaps one of the above "sync_rendered = TRUE" should be " = FALSE" ...

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]