Re: Speed of Gdk-Pixbuf Vs. GdkRGB



Hi,

"David J. Singer" <doc deadvirgins org uk> writes:

> On Wednesday 21 April 2004 6:13 pm, John Cupitt wrote:
> >
> > They are equivalent (AFAIK). You only need the lower-level stuff if you
> > want to avoid loading the whole image into memory
> 
> OK. That's interesting. I kinda assumed GdkRGB would be loads faster 
> because it has a much "lower-level" feel to it... 

You are right about that since you are comparing apples and pears
here. GdkRGB and GdkPixbuf aren't exchangeable. Actually if you draw a
GdkPixbuf, GdkRGB might be used. What happens exactly depends on the
type of pixbuf. Pixbufs with alpha channel are blended with the screen
content using the XRender extension. This will in most cases be faster
that getting the screen content, blending with it and writing the
blended result back. If there's no need for blending because the
pixbuf is opaque, a GdkImage (or rather a set of pre-allocated scratch
images) is being used to render the pixbuf to screen.

If you need to render the pixbuf often and don't need blending, you
should consider to draw it to an offscreen pixmap (a GdkPixmap) and
use that to blit the image to the screen.


Sven



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]