Re: pixbuf<->cairo_surface_t conversion

Matthias Clasen <matthias clasen gmail com> writes:

> On Thu, Sep 2, 2010 at 7:24 PM, Havoc Pennington <hp pobox com> wrote:
> > I was thinking about the problem of wasting memory, writing to one
> > internal representation and not changing the other, etc. How about
> > this: we only keep one representation around. If you get_pixels we
> > drop the surface, if you get_cairo_surface we drop the old-style
> > pixels.
> >
> > We deprecate get_pixels() which is the only call that can force the
> > old-style representation to be created. If you do use get_pixels(),
> > what's going to happen is that you do your pixel editing, and on the
> > next paint gdk_pixbuf_get_cairo_surface() will force conversion back
> > to cairo representation.
> >
> Here is an (untested) patch to implement this.

Not that it matters that much, but if you use cairo_mask() with the
pixbuf data as both source and mask, the source as RGB24 and the mask
as ARGB32, you could make cairo do the conversion from pixbuf to
surface. That would likely hit an SSE2 or ARM NEON optimized code path
in pixman.


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