flush: Detach mime data

Drawing directly to a surface has to be surrounded with cairo_surface_flush()
and cairo_surface_mark_dirty().

However, if the surface has mime data associated, this would hit the following
assert:

lt-cairo-test-suite: cairo-surface.c:1381: cairo_surface_mark_dirty_rectangle:
Assertion `! _cairo_surface_has_mime_data (surface)' failed.

This is now fixed by detaching all mime data in cairo_surface_flush().

Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41409

Fixes: create-from-png, create-from-png-stream

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2011-10-08 13:40:11 +02:00
parent b9e5cd9572
commit a419d00fbe

View file

@ -1314,6 +1314,7 @@ cairo_surface_flush (cairo_surface_t *surface)
/* update the current snapshots *before* the user updates the surface */
_cairo_surface_detach_snapshots (surface);
_cairo_surface_detach_mime_data (surface);
if (surface->backend->flush) {
status = surface->backend->flush (surface);