Re: Why run xserver on the OpenGL API?

Keith Packard <[email protected]>
Newsgroups gmane.comp.freedesktop.xserver
Message-ID <[email protected]>
Around 12 o'clock on Nov 25, Jon Smirl wrote:

> My understanding is that Cairo is a retained mode interface and OpenGL is an
> immediate mode one. So we are comparing apples and oranges.  Maybe someone can
> elighten me, why is Cario being designed instead of just using the SVG API? Is
> Cairo going to be integrated with stylesheets like SVG? If not, what good is
> this to the browser developers?

No, cairo is an immediate mode API.  I think we've learned not to build 
retained mode interfaces as the sole mechanism for graphics...

SVG can be built atop cairo quite nicely (and has been).  Cairo focuses on 
consistent device-indepedent output with an easy to use PostScript 
rendering model.

> My goal is to ensure that OpenGL is available on every Linux desktop as
> soon as possible. A big reason we don't have Linux games is that the status
> of OpenGL support under Linux is pretty chaotic. A pervasive OpenGL API is
> the key to getting mainstream apps to use it, but it will take years of
> deployments before this happens. This says nothing about using the Cairo
> API, Cairo is retained mode which is a different beast,

I think that's a good goal, but somewhat orthogonal to providing good 2D 
apis for applications.  As long as we build these 2D application APIs so 
that they lay atop some system which depends on OpenGL for it's output on 
desktop systems, it sounds like that'll do what you want too.

> It it better to write a toolkit to Cairo and then have Cairo convert to GL, or
> is it easier to just write the toolkit to use GL? This is assuming that the
> toolkits already have xlib support.

Yes, cairo provides a more comfortable 2D interface for typical desktop
applications than GL does.  Plus, it supports other window systems (like OS
X and Windows), printing and the generation of bitmap images, which are 
very important to open source application developers.

> Another obvious point is that since GL doesn provide fonts, a font library is
> needed. Would this be provided by Cairo? Can I freely intermix GL drawing and
> Cairo to the same window?

You can with X today, I don't know about the GL backend as I don't have a 
system that supports GL available to me (which points out nicely your 
issue above).

-keith
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.