[cairo] cairo pattern/glitz patches
Kristian Høgsberg
krh at bitplanet.net
Mon Feb 21 19:53:57 PST 2005
David Reveman wrote:
> I've split up my pending pattern updates and glitz backend updates as
> much as possible. Here's a set of patches. They need to be applied in
> the following order:
I've looked through this and I think it looks really good. These
patches implement most of the pending backend API changes that we
discussed and I think we should get this into cvs as soon as possible.
Just a couple of minor nitpicks:
Should _cairo_*_surface_change_attributes() be called
_cairo_*_surface_set_attributes instead? It's implemented by calling a
number of setter functions...
I'm not a big fan of the preprocessor hacks in the cairo_pattern_t
definition, I prefer the nested structs union approach:
struct _cairo_pattern {
/* common fields */
cairo_pattern_type_t type;
int field1;
int field2;
/* type specific fields in union */
union {
struct { int foo; } solid;
} u;
};
even though it adds an extra .u in all the pattern expression. C sucks
sometimes and I think it's better to suck it up than to try to hack
around it.
How about passing the pattern type to _cairo_pattern_init()?
As for the pixman patch, my immediate response was that the order or
traps and ntraps arguments is reversed compared to the other pixman
calls. Looking closer at pixman_composite_trapezoids I came across some
odd looking code. If pixman_composite_trapezoids doesn't need to
implement the RENDER behavior where you can pass in a mask format or
NULL to determine the compositing behaviour, there's a fair amount of
code that can be removed; see my attached alternative pixman patch.
cheers,
Kristian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pixman-cleanup-and-add-traps.patch
Type: text/x-patch
Size: 4385 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050221/0b5a13d8/pixman-cleanup-and-add-traps.bin
More information about the cairo
mailing list