[cairo] Large number of glReadPixel method calls

Charles Tuckey ctuckey at verano.com
Wed Jul 28 09:13:29 PDT 2004

Hi David,

The latest version of Glitz gets rid of the major leak on all our 
systems. However, the Matrox (XiG driver) system runs our application 
very, very slowly and uses quite a bit of CPU. The XiG driver has a 
great feature - we can set an environment variable and it prints out all 
the GL calls that are being made. When we did this, it appears as though 
  a call to glReadPixels() is the bottleneck. When running our memory 
leak test program (see Possible Memory Leak Using Glitz Surfaces) we see 
that this method is called after every call to cairo_show_text.

Do you have any suggestions? Is the call to glReadPixels() a direct 
result of what's being done in the glitz library or is it a side effect 
generated by the XiG driver?

If it would be useful to you I can send the log of all the GL commands 
generated by the XiG driver.

FYI, here is what the XiG support person had to say:

    glReadPixels() should be used sparingly because it can cause the
    entire GL rendering process to halt while it synchronizes and fetches
    data from the card.  I notice the ReadPixels is over a relatively
    'huge' area:

      'glReadPixels(x=0, y=0, width=400, height=400, format=80e1, 
type=1401, pixels=50ab4008)'


More information about the cairo mailing list