Re: Why run xserver on the OpenGL API?

Owen Taylor <[email protected]>
Newsgroups gmane.comp.freedesktop.xserver
Message-ID <[email protected]>
On Tue, 2003-11-25 at 15:21, Jon Smirl wrote:
> --- Keith Packard <[email protected]> wrote:
> > The latter is a much stronger statement that encourages/forces application
> > developers to migrate to a strange and possibly inappropriate graphics
> > model.  Far better is to provide appropriate glue between the API they want
> > to use and the graphics hardware, let them use GL where appropriate, and
> > also provide support for cairo and xlib.  Cairo is a clean 2D API that can
> > live atop either xlib, Render or GL, and exposes a full PDF 1.4 rendering
> > model which is as close to 'complete' as we've seen in a 2D API.
> 
> 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?

Cairo is immediate mode. The comparison to PDF-1.4 I think is a
confusing one. It's also not really an accurate one, since while Cairo
has powerful capabilities *similar to* PDF,  it's only really PDF
equivalent at the put-pixel graphics API equivalent of
"Turing-complete". It doesn't have anything like all of PDF's 
photoshop derived layer modes, for instance.

[...]

> > So, if you just mean migrating to using GL for 2D rendering, then I think
> > that's a bit pushy, and I would rather see us build a system that gets from
> > whatever 2D api the developer is using to the hardware as conveniently as
> > possible.  For existing applications, we want the X server to map X
> > rendering calls to GL function calls, for new applications I'd really
> > rather see them written to cairo which can use GL where available, and fall
> > back to either Render or the core protocol where necessary.
> 
> 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.

As a toolkit author, I can say I'd much rather use Cairo every day of
the week than the 2D parts of GL. GL's 2D API is simply not that nice.
Also, note that it's very important to me to have a graphics API that is
shared with printed output; and GL is rather an unusual choice for a 
printer API...

> 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?

Cairo will integrate well with our current font architecture. (FreeType,
fontconfig, a layout engine such as Pango.)

Whether GL and Cairo can be mixed probably depends on details of the
driver model. You'd also have various API details to figure out. (What
does a Cairo group mean when using GL commands)

Regards,
							Owen
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.