After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 621571 - Fix damage events on offscreen windows
Fix damage events on offscreen windows
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-06-14 17:19 UTC by Michael Natterer
Modified: 2010-08-11 04:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The patch (1.64 KB, patch)
2010-06-14 17:21 UTC, Michael Natterer
none Details | Review
Improved and optimized patch (5.72 KB, patch)
2010-06-15 13:47 UTC, Michael Natterer
accepted-commit_now Details | Review

Description Michael Natterer 2010-06-14 17:19:47 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.
Comment 1 Michael Natterer 2010-06-14 17:21:07 UTC
Created attachment 163613 [details] [review]
The patch
Comment 2 Michael Natterer 2010-06-15 13:47:00 UTC
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.
Comment 3 Matthias Clasen 2010-08-04 02:14:24 UTC
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
Comment 4 Michael Natterer 2010-08-04 06:04:49 UTC
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.
Comment 5 Matthias Clasen 2010-08-04 22:46:39 UTC
I've committed the part that still applies to Benjamins rendering-cleanup branch, from where it will get merged shortly.