nanogui: GrCopyArea is blocking on X11


Previous by date: 22 May 2006 13:48:34 +0100 re;Re: [nanogui] dis chinese font, "=?gb2312?B?zOzS7Q==?="
Next by date: 22 May 2006 13:48:34 +0100 Font support, Atul Kulkarni
Previous in thread:
Next in thread: 22 May 2006 13:48:34 +0100 Re: GrCopyArea is blocking on X11, Martin Hansen

Subject: GrCopyArea is blocking on X11
From: Martin Hansen ####@####.####
Date: 22 May 2006 13:48:34 +0100
Message-Id: <1148303337.4009.23.camel@dustpuppy>

Hi 

I have made a small app that show a graph scrolling verticaly across its
window (a heart monitor demo)

First i made it so that it would redraw the whole graph every time, this
gave some flicker.
So i redesigend it to use GrCopyArea, now I copy the graph inside the
sanme window with an offset, and just dram the new part of the graph.
(Se code snippet below)

The update of the graph is based on a timer event.

My problem is that when using the flickery version where i redraw the
complete graph, everythis is working fine. But when using GrCopyArea
version, the program suffers from considerable delays, but only on X11,
I have the same app running fine on a mips32 target, using framebuffer.

I discovered that when the delay occours i had to make some mouse events
by just moving the mouse arround inside the microwindows window.

I had a suspicion that the eventloop was somehow broken, so i made a new
app. whth only the graph code just running inside a for() loop. no
events checking at all.
On my mips32 target this version runs for a short while, scrolling the
graph at high speed until the for loop ends and exits as suposed to. But
the X11 version still suffers from delays until i move the mouse arround
in the window, this despite that i no not look at events at all.

By use of printf debugging i see that it is the GrCopyArea function that
blocks. but not every time, it can run a few turns in the loop then it
bloks until a move the mouse, maybe becuase of events in the eventque.

void HeartGraph(){
    const unsigned int data[]= {30,30,30,15, 0, 5,15,20,25,30,
				35,40,45,50,35,20,30,40,25,35,
				30,30,30,30,30,30,30,30,30,30,
				30,30,30,30,30,30,30,30,30,30,
				30,30,30,30,30,30,30,30,30,30};

    static int index;
    GrCopyArea(heartgW, heartgGC, 0, 0, OUT_WIN_WIDTH-2, OUT_WIN_HEIGHT,
	       heartgW, 1, 0, 0);

    GrLine(heartgW, heartgGC,
OUT_WIN_WIDTH-4 ,data[index],OUT_WIN_WIDTH-3,data[index+1]);    
    index=(++index)%49;
}


-- 
Med venlig hilsen/mojn/regards
Martin Hansen
Center for Software Innovation
Stenager 2, DK-6400 Sønderborg, Web: www.cfsi.dk

Previous by date: 22 May 2006 13:48:34 +0100 re;Re: [nanogui] dis chinese font, "=?gb2312?B?zOzS7Q==?="
Next by date: 22 May 2006 13:48:34 +0100 Font support, Atul Kulkarni
Previous in thread:
Next in thread: 22 May 2006 13:48:34 +0100 Re: GrCopyArea is blocking on X11, Martin Hansen


Powered by ezmlm-browse 0.20.