[cairo] Re: [Mesa3d-dev] Points in Cairo Glitz paper
c99drn at cs.umu.se
Sun Apr 25 17:49:08 PDT 2004
On Sun, 2004-04-25 at 11:01 -0600, Marcelo E. Magallon wrote:
> On Wed, Apr 21, 2004 at 08:11:53AM -0700, Jon Smirl wrote:
> > The best way to do this would be to perform compositing with a mask
> > surface directly without the creation of an intermediate surface.
> > Even though the fixed OpenGL pipeline does not seem to allow for such
> > an operation, glitz is able to do this on hardware that supports
> > fragment programs.
> Glitz does this:
> TEMP color;
> /* temporary */
> TEMP mask;
> /* src texture */
> TEX color, fragment.texcoord, texture, 2D;
> /* pd operation */
> TEX mask, fragment.texcoord, texture, 2D;
> MUL result.color, color, mask.a;
> which can also be expressed in OpenGL as:
> glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
> glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
> by loading the mask in GL_LUMINANCE format and binding the object to
> texture unit 1.
This would be the ideal solution for surfaces that only contain an alpha
channel (which are the surfaces mostly used as mask surfaces). It may
not be that good with surfaces that contain all four color channels
(pbuffers used with "render to texture" especially).
With the above working for alpha-channel surfaces we can get efficient
text rendering with cairo's OpenGL backend only by using
> I didn't take a closer look at the convolution operation and I'm not
> sure if the imaging extensions are capable of providing equal
I've actually tried using the imaging extensions for convolution
filtering but it turned out terribly slow.
David Reveman <c99drn at cs.umu.se>
More information about the cairo