[cairo] drawing a subimage
Jeff Bezanson
jeffbez at comcast.net
Sun May 7 16:33:22 PDT 2006
Yes, that works too, and I also tried it, except it is at least as slow,
possibly slower.
I was assuming that the slowdown comes from unnecessarily touching every
image pixel, but perhaps the pipeline stages are smart enough to
communicate the fact that the output will be clipped and thus avoid some
processing upstream. If so, I guess the slowdown could be coming from
something else.
So OK, if my assumption is wrong, then never mind. I'll just go back to
using my manual pixel copying loop :)
-Jeff
On Sun, 2006-05-07 at 18:25, Christian Biesinger wrote:
> Jeff Bezanson wrote:
> > cairo_rectangle(cr, 0, 0, w, h);
> > cairo_clip(cr);
> > cairo_set_source(cr, pt);
> > cairo_matrix_init_translate(&matrix, xoffs, yoffs);
> > cairo_pattern_set_matrix(pt, &matrix);
> > cairo_paint(cr);
>
> Couldn't you just fill a rectangle? E.g.:
>
> cairo_set_source(cr, pt);
> cairo_matrix_init_translate(&matrix, xoffs, yoffs);
> cairo_pattern_set_matrix(pt, &matrix);
> cairo_rectangle(cr, 0, 0, w, h);
> cairo_fill(cr);
>
> ______________________________________________________________________
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo
More information about the cairo
mailing list