GNOME Bugzilla – Bug 621571
Fix damage events on offscreen windows
Last modified: 2010-08-11 04:07:02 UTC
Currently, offscreen windows emit damage only from gdk_draw implementations. This is bad for two reasons: - cairo drawing doesn'r generate damage - there can be a *lot* of drawing operations during an expose Will attach a patch that: - disables all damage creation in gdkoffscreenwindow.c - generically adds a damage area after an offscreen window has been exposed This patch seems to fix all artifacts i observed in GIMP, and is probably quite an optimization.
Created attachment 163613 [details] [review] The patch
Created attachment 163678 [details] [review] Improved and optimized patch After a discussion with Alex, here is an ad-hoc optimized patch that emits "damage" only once per recursive validation, on the original region on the impl window. This is much better already but still not perfect. The new patch also entirely removes damage generation from GdkOffscreenWindow itself.
Review of attachment 163678 [details] [review]: Looks good to me, if you take care of the comments below ::: gdk/gdkoffscreenwindow.c @@ +355,2 @@ max_y = MAX (max_y, points[i].y); } I think here, the entire if can go if we no longer add damage. @@ +431,1 @@ } Same here, no need to calculate min_x/y anymore. ::: gdk/gdkwindow.c @@ +5212,3 @@ + _gdk_window_add_damage ((GdkWindow *) private->impl_window, + expose_region); + } Can do without {} here
Thanks, i'll take care of the fixes and commit. Please note that this patch is only an intermediate step, I need to get back to Alex about a more general approach to handle implicit paints, which would include damage event generation.
I've committed the part that still applies to Benjamins rendering-cleanup branch, from where it will get merged shortly.