|
From: <hez...@us...> - 2009-10-05 21:06:27
|
Revision: 10513
http://plplot.svn.sourceforge.net/plplot/?rev=10513&view=rev
Author: hezekiahcarty
Date: 2009-10-05 21:06:17 +0000 (Mon, 05 Oct 2009)
Log Message:
-----------
Only update xcairo window on the last expose event
If several expose events occur quickly, it would previous trigger
the same number of plot window redraws. This update speeds things up a
bit in this case by ignoring all but the last expose event. The can help
the window feel a bit more responsive. The downside is that quickly moving
the plot window partly off then back on screen with a non-compositing
window manager can highlight these less frequent updates.
A better fix would be to only update the portion of the window which has
been affected by the expose event. This should keep the window feeling
responsive and avoid any artifacts from repeat expose events.
Modified Paths:
--------------
trunk/drivers/cairo.c
Modified: trunk/drivers/cairo.c
===================================================================
--- trunk/drivers/cairo.c 2009-10-04 17:03:08 UTC (rev 10512)
+++ trunk/drivers/cairo.c 2009-10-05 21:06:17 UTC (rev 10513)
@@ -1551,9 +1551,12 @@
aStream->exit_event_loop = 1;
break;
case Expose:
- /* Blit the image again after an expose event. */
- blit_to_x(aStream);
- XFlush(aStream->XDisplay);
+ /* Blit the image again after an expose event, but only for the last
+ available event. Otherwise multiple redraws occur needlessly. */
+ if (((XExposeEvent *)&event)->count == 0) {
+ blit_to_x(aStream);
+ XFlush(aStream->XDisplay);
+ }
break;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|