[Pixman] pixman_region_init_from_bitmap patched

Soeren Sandmann sandmann at daimi.au.dk
Wed Feb 17 07:30:23 PST 2010

Alexander Larsson <alexl at redhat.com> writes:

> > - I think the API should take a pixman_image_t instead of pointers. I
> >   know I said otherwise on IRC, but we need the information in the
> >   image struct so that we can deal with accessors. If we add subimages
> >   in the future, we will probably need this function to work on those
> >   as well.
> Hmmm, in the usecase i needed this for (spice) i need to be able to
> create a region of a sub-rectangle of an bitmask. I guess i could do
> this by creating a new temporary pixman_image_t using the same data and
> stride but different offset and w/h.

The trouble with subimages is that they can start in the middle of a
byte. With the pixman_image_t API we can later add something like
pixman_image_create_subimage() that would take an offset in pixels.

This is something that we will eventually need anyway to get correct
support for windows in XRender, and to do subsurfaces in cairo.

> > - One style comment: if one branch of an if statement has braces, the
> >   other should as well.
> Do you have a set of indent argument for pixman style? That would be
> convenient when converting X code.

When I did the refactoring, I used uncrustify


with this configuration file:


The output is not perfect; it still needs some manual checking. In
particular, I don't think it catches the brace rule.

To convert camel case to underscores, I just used sed
expressions. Many of them are in the log. See
a98b71eff4041df58c9dcc2b1e25cefa38f364ff for example.


More information about the Pixman mailing list