[Spice-devel] [PATCH 10/30] Convert cairo canvas draw_fill() to using pixman

Soeren Sandmann sandmann at daimi.au.dk
Sun Feb 21 01:23:14 PST 2010


Alexander Larsson <alexl at redhat.com> writes:

> +    /* round down X to even 32 pixels (i.e. uint32_t) */
> +    extents.x1 = extents.x1 & ~(0x1f);
> +
> +    mask_data = (uint32_t *)((uint8_t *)mask_data + mask_stride * extents.y1 + extents.x1 / 32);
> +    mask_x -= extents.x1;
> +    mask_y -= extents.y1;
> +    mask_width = extents.x2 - extents.x1;
> +    mask_height = extents.y2 - extents.y1;
> +
> +    spice_pixman_region32_init_from_bitmap (&mask_region,
> +                                            mask_data,
> +                                            mask_width, mask_height,
> +                                            mask_stride / 4);

Please don't assume that pixman strides are always a multiple of 4
bytes. This is something that will almost certainly change at some
point.

In this particular case, init_from_bitmap() will be replaced with the
one from pixman which doesn't make the assumption, so it's not a big
deal here, but if there are other places, we'll probably need to fix
them.


Soren


More information about the Spice-devel mailing list