ClutterX11TexturePixmap: Optimize ConfigureEvent handling
authorOwen W. Taylor <otaylor@fishsoup.net>
Tue, 5 Oct 2010 17:05:45 +0000 (13:05 -0400)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Wed, 24 Nov 2010 16:19:21 +0000 (16:19 +0000)
commit9df6f0c52445ef9c3c5343c1f0aee63c67bffe06
tree323d8142f443ed6c18d2b6ed5358f974a05a0321
parent1fdd82fcf1234a9b6c6fbcff05a62ce8f1eefcab
ClutterX11TexturePixmap: Optimize ConfigureEvent handling

ClutterX11TexturePixmap watches for configure events to tell when it
needs to name a new pixmap for the window. However, ConfigureEvents
occur on moves in addition to resizes, and doing round trips and
naming new pixmaps every time a window is moved is a real performance
killer.

Add clutter_x11_texture_pixmap_sync_window_internal() that takes the
size/position of the window as arguments rather than always calling
XGetWindowAttributes. This allows us to bypass all work other than
notifying the window-x/window-y properties when we get a ConfigurEvent
for a move.

The last received width/height is saved to allow us to also omit
XGetWindowAttributes on MapNotify events.

The public clutter_x11_texture_pixmap_sync_window() becomes a bit less
efficient since we no longer combine the roundtrips for
XGetWindowAttributes() and XCompositeNameWindowPixmap(), but it appears
to have no callers in current publicly available code.

Several FIXME's are added for areas where there are still weird things
going on in the code or improvements could be made.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2356
clutter/x11/clutter-x11-texture-pixmap.c