[cairo] New surface: cairo_combined_surface_t
Vladimir Vukicevic
vladimirv at gmail.com
Thu Jun 1 09:31:37 PDT 2006
On 5/31/06, Kouhei Sutou <kou at cozmixng.org> wrote:
> To solve those problems, I suggeste that cairo provides a surface can combine
> some surfaces and show those surfaces as a surface to cairo_t. And then, we can
> write the above code as the following:
>
> ...
> combined_surface = cairo_combined_surface(ps_surface, pdf_surface, NULL);
Not a bad idea, but I think it will be difficult to implement in
practice. The surfaces will almost certainly need fallback for
different operations, and fallback happens in the generic surface
layer, signalled by the backend surface returning an error code
stating that the operation is unsupported. In the combined_surface
case, the actual backend is the combined surface.
So, when a composite request comes in that the pdf surface can hande,
but the ps surface can not, you need the fallback to happen for the ps
surface but not for the pdf surface. You can't return unsupported,
since that would cause fallback rendering to happen for both -- so
you'd have to implement the fallback yourself.
This might not be as bad as it sounds, since a lot of that code is
abstracted away in cairo-surface-fallback, but a lot is not; it may be
more trouble than it's worth, especially given the duplication of
fallback handling code.
- Vlad
More information about the cairo
mailing list