[cairo] introducing a "context backend"
Benjamin Otte
otte at redhat.com
Fri Apr 23 02:14:40 PDT 2010
So what you basically want is a custom cairo_gstate_t?
I think that's a great idea, I only fear it'd take a lot of code to get
that abstraction going and to make sure it sits at the right place. And
only then can you start the "total conversion" for the backends (which
will probably take almost as long).
But then, Chris pretty much rewrote all important surface backends to a
new API, so I might be overestimating the work needed...
Anyway, I'm all for it.
Benjamin
On Fri, 2010-04-23 at 11:59 +1200, Robert O'Callahan wrote:
> For cairo backends that wrap high-level drawing APIs like Quartz and
> D2D, exposing the platform API as a surface backend isn't a very good
> fit. An ID2D1RenderTarget and a CGContext are much more like a cairo
> context than a cairo surface: for example, they have a CTM. For
> efficiency, we would like to avoid buffering path data in a
> cairo_path_fixed_t and converting to native path data in a separate
> pass --- avoiding conversion from double to cairo_fixed_t and back to
> double; this suggests we need some kind of native path object stored
> in the cairo_t. (For optimal performance with Quartz, we would want to
> be emitting the path directly into a CGContext.) Our
> cairo_retained_path_t API lets us avoid this overhead in some cases,
> but in others (e.g. existing scripts that use <canvas> to render paths
> over and over again) reducing the cairo overhead of immediate path
> filling and stroking is essential.
>
> How would people feel about introducing some kind of "context backend"
> that lets pretty much all of the functionality of a cairo_t be passed
> straight through to a platform context backend?
>
> Rob
> --
> "He was pierced for our transgressions, he was crushed for our
> iniquities; the punishment that brought us peace was upon him, and by
> his wounds we are healed. We all, like sheep, have gone astray, each
> of us has turned to his own way; and the LORD has laid on him the
> iniquity of us all." [Isaiah 53:5-6]
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
More information about the cairo
mailing list