traverso-devel
[Top][All Lists]
Advanced

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

Re: [Traverso-devel] playhead cpu usage, crosshair like implementation n


From: Jonatan Liljedahl
Subject: Re: [Traverso-devel] playhead cpu usage, crosshair like implementation needed ?
Date: Wed, 07 Feb 2007 12:36:11 +0100
User-agent: Thunderbird 1.5 (X11/20051025)

Remon wrote:
> Hi,
> 
> I've tried _again_ to solve the cpu hogging by playhead painting, but to no 
> avail.
> 
> What happens:
> 
> The canvas (QGraphicsView) internally uses a backinstore (QPixmap). Every 
> time 
> a canvas item moves, or calls update(), the rectangle that has to be painted 
> is added to the 'exposed region'
> 
> This region that consists of all the exposed rectangles is _cleared_, and in 
> the paint event all the items that intersect with a given rectangle in the 
> region is added in the 'itemstobepaintedlist'
> 
> When the playhead moves, the exposed regions simply get cleared!
> Now, faking that the playhead is only 1x1 large, and still painting it with 
> the vertical size of the canvas view doesn't work, the area isn't in the 
> region, and thus doesn't get updated by the backingstore! (and we see a 
> playhead of 1 pixel moving at the top)
> 
> My idea was, with the above scenario, to first create a copy of the canvas at 
> the old position of the playhead, of course only the region that it covers, 
> and restore it before it moves. Making a copy of a Pixmap and drawing it back 
> is much cheaper then drawing all the items underneath the playhead!!
> 
> If any of you have an idea how to 'solve' this issue, let me know please, I'm 
> prety much stuck :-(

I don't know if this could help, but in my app KyCE I use cairo to
render my graphics (curves and all that, and playhead) to a GdkDrawable.
 I do the actual drawing of all items to offscreen cairo surfaces, and
then I just paint these surfaces onto the GdkDrawable (the actual X11
window) in the expose callback, and draw the simple playcursor on top of
that. So, I only need to do actual redraw when any item (curves,
timegrid, etc..) changes. The expose routine is fast, since it only
paints the already-drawn surfaces onto the screen.

-- 
/Jonatan    -=( http://kymatica.com )=-




reply via email to

[Prev in Thread] Current Thread [Next in Thread]