[cairo] [patch] XCopyArea fast path

Carl Worth cworth at east.isi.edu
Tue May 18 13:04:55 PDT 2004


On Tue, 18 May 2004 10:51:08 -0400, graydon hoare wrote:
> this patch adds a fast path to the xlib backend to call XCopyArea when 
> it detects a "surface showing" operation with no mask and a SRC 
> compositing operator. this is handy when doing double buffered drawing 
> with cairo, as I can have cairo composite the final "image".

The implementation of the patch looks fine to me.

Two minor style issues below, (though I wouldn't even mind if you
committed before fixing these).

> +#define CAIRO_FIXED_IS_INTEGER(x) (((x) & 0xFFFF) == 0)
> +#define CAIRO_FIXED_INTEGER_PART(x) ((x) >> 16)

I'd suggest making these namespace-compatible with existing functions
like _cairo_fixed_from_int. I don't really care if the implementations
are functions or macros though. You could change some of the existing
functions to be macros if you'd like.

And if they all become macros, I don't care if they all use the
CAIRO_FIXED names.

Just as long as things are consistent.

> +static int 
> +_is_simple_integer_translation(cairo_matrix_t *mat, 
> +			       int *itx, int *ity)

And this one should be in cairo_matrix.c as
_cairo_matrix_is_integer_translation or some such.

-Carl




More information about the cairo mailing list