[cairo] [PATCH] pixman: fast path for nearest neighbour scaled compositing operations.

Soeren Sandmann sandmann at daimi.au.dk
Sat May 30 10:58:29 PDT 2009


Hi,

> > > +/*
> > > + * Check if we actually have source clipping. Just comparing pointers
> > > + * does not work, so full comparison of regions is needed. Source
> > > + * clipping is enforced in X server since the fix of
> > > + * http://bugs.freedesktop.org/show_bug.cgi?id=11620
> >
> > Why isn't comparing pointers sufficent for checking source clipping?
> >
> > pixman_image_set_source_clipping() does
> > 	common->src_clip = &common->full_region;
> > when source_clipping is false.
> 
> As described in the comment, it just does not work well in X server. X server
> marks all the images as having source clipping unconditionally and always hits
> the slow path, hurting performance.

See this mail:

    http://lists.cairographics.org/archives/xorg-devel/2009-May/000819.html

I sent a patch to implement this here:

    http://lists.cairographics.org/archives/xorg-devel/2009-May/000893.html

Unfortunately, that patch doesn't work because a lot of the
untransformed code paths in pixman assume that they will never be
called with coordinates outside the sources. This is broken; they need
to deal with the repeat modes instead.

Clipping in Render and pixman is a mess. The clip-in.c test program
demonstrates that setting a transformation matrix completely changes
the interpretation of the clip, even though the transformation is just
a 0.001, 0.001 translation.

I intend to fix this as part of the refactoring. The plan is
essentially move all source clip handling into
pixman_compute_composite_region(); the rest of the code can then
forget that clipping even exists, but in return it will need to use
pixman_walk_composite_region() and deal properly with repeat modes.

In this particular case, for now please just use
pixman_region32_equal().


Soren


More information about the cairo mailing list