[cairo] Expensiveness of calls

Gerdus van Zyl gerdusvanzyl at gmail.com
Tue Oct 9 09:25:13 PDT 2007


I use a lot of translate and clipping commands. My question is how
expensive are they, should they be minimized or do they have minimal
impact?

My main render function looks like this and is repeated for 90 objects (c):
--------------
self._clipit(ctx, c) # performs three clipping rectangle operations
                          # to ensure a child does not extend beyond
parent bounds

ctx.translate(c.left,c.top)
c.renderctx(ctx) #widget draw itself using cairo context

#reset
ctx.translate(-c.left,-c.top)
ctx.reset_clip()
--------------
    def _clipit(self,ctx,e):
        if not e.parent == None:
            self._clipit(ctx, e.parent)

        ctx.rectangle(e.left,e.top,e.width,e.height)
        ctx.clip()
--------------


Thank You,
Gerdus van Zyl


More information about the cairo mailing list