davidr at novell.com
Mon Dec 18 10:24:19 PST 2006
On Mon, 2006-12-18 at 15:34 +0000, Ignas B. wrote:
> Is glitz_set_rectangle the optimum way of drawing a rectangle in terms
> of speed.
> I tested it against simple gtk rectangle drawing (with
> glitz_set_rectangle) and the results were that the gtk application is
> giving slightly faster drawing Could it be true that gtk is as fast as
No glitz_set_rectangle is not the optimum way to draw a rectangle.
glitz_composite with a solid surface as source is what you should use.
glitz_set_rectangle is just a convenience function that is most useful
for filling a solid 1x1 surface, it's not necessarily giving you any
acceleration at all.
gtk is using the xserver to draw that rectangle and that your xserver
driver is able to fill a solid rectangle slightly faster than opengl is
no surprise. There's more overhead in sending an opengl drawing command
than using the 2d hardware on the server side to fill a solid rectangle.
When increasing the number of rectangles and the size of them this
overhead will likely become insignificant. Solid rectangle drawing
performance is likely not going to be a bottleneck anyhow.
> The thing is that its only trying to draw 2d primitive - rectangle. As
> i imagine opengl does not give an acceleration for 2D primitives. Am i
no, it's accelerated but it's likely not going to be faster than the 2d
More information about the cairo