summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2011-07-16 16:47:30 +0200
committerUli Schlachter <psychon@znc.in>2011-07-17 17:53:23 +0200
commit0dc63f5bb409de0013bf845f96383cc9dca27980 (patch)
tree4d180271686fbba6badad7a6e0e4c38167478a22 /util
parent27692ca75967b482ff1bd0ffbca8b4e3551776f7 (diff)
cairo-trace: Fix mark-dirty with xcb backend
cairo-xcb's acquire_source_image implementation will attach the image it returns as a snapshot to the xcb surface. cairo_surface_mark_dirty_rectangle asserts that the surface doesn't have any snapshots attached. cairo-trace will emit the surface to the trace when it was marked dirty by drawing it to an image surface. The combination of these three things caused a failed assertion when cairo-trace was used on something which uses xcb/Xlib and which uses mark_dirty. I found this with firefox and xlib-xcb. Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'util')
-rw-r--r--util/cairo-trace/trace.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index b8fd04ed..3470c88b 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -3584,6 +3584,12 @@ cairo_surface_mark_dirty (cairo_surface_t *surface)
{
_enter_trace ();
_emit_line_info ();
+
+ /* Call cairo before emitting the trace since _emit_surface() might cause
+ * snapshots to be creates while mark_dirty assert()s that there are none.
+ */
+ DLCALL (cairo_surface_mark_dirty, surface);
+
if (surface != NULL && _write_lock ()) {
if (_mark_dirty) {
_emit_surface (surface);
@@ -3593,8 +3599,6 @@ cairo_surface_mark_dirty (cairo_surface_t *surface)
_trace_printf ("%% s%ld mark-dirty\n", _get_surface_id (surface));
_write_unlock ();
}
-
- DLCALL (cairo_surface_mark_dirty, surface);
_exit_trace ();
}
@@ -3603,6 +3607,12 @@ cairo_surface_mark_dirty_rectangle (cairo_surface_t *surface,
int x, int y, int width, int height)
{
_enter_trace ();
+
+ /* Call cairo before emitting the trace since _emit_surface() might cause
+ * snapshots to be creates while mark_dirty assert()s that there are none.
+ */
+ DLCALL (cairo_surface_mark_dirty_rectangle, surface, x, y, width, height);
+
_emit_line_info ();
if (surface != NULL && _write_lock ()) {
if (_mark_dirty) {
@@ -3615,8 +3625,6 @@ cairo_surface_mark_dirty_rectangle (cairo_surface_t *surface,
_get_surface_id (surface), x, y, width, height);
_write_unlock ();
}
-
- DLCALL (cairo_surface_mark_dirty_rectangle, surface, x, y, width, height);
_exit_trace ();
}