summaryrefslogtreecommitdiff
path: root/src/cairo-xcb-private.h
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2011-02-11 22:25:12 +0100
committerUli Schlachter <psychon@znc.in>2011-02-12 10:34:02 +0100
commit12e41acf9c23618748036052f3403e6ece295796 (patch)
tree2d89a62472f6e8cbccf28d31f07bfb69bb58625b /src/cairo-xcb-private.h
parent050a877a9e6a0066200783f1e200eaaf6792e5de (diff)
downloadcairo-12e41acf9c23618748036052f3403e6ece295796.tar.gz
xcb: Remove the surface pattern cache
Whenever a surface is used as a source, cairo-xcb creates a Picture for it and adds it as a snapshot to the source. Additionally, there is a per-screen cache that makes sure old Pictures are destroyed when more than 16 MiB of image data is used. There are two problems here: - Normally, the Picture would be destroyed once it is no longer a snapshot for the original source surface. However, the cache kept it alive for longer which means it was using memory but couldn't actually be used any more. (The Pictures are found via _cairo_surface_has_snapshot) - When a xcb surface is used as a source, we create a new Picture for it, but when that surface is cairo_surface_finish'd, we don't FreePicture this Picture. When the drawable was a window, this may later on cause a BadPicture error when cairo tries to explicitly free a picture that was already implicitly freed when its window was destroyed. The second point caused lots of tests in the test suite to fail on an assert due to the above-mentioned BadPicture error, but just removing the cache makes both these problems go away. The only downside is that the cache enforced a limit of 16 MiB of pixel data that was used for source surfaces on the server. After this commit the Picture will be kept alive until the snapshot is detached. If this becomes a problem memory-wise, a new solution will have to be invented... Signed-off-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'src/cairo-xcb-private.h')
-rw-r--r--src/cairo-xcb-private.h9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/cairo-xcb-private.h b/src/cairo-xcb-private.h
index 6bf6ef858..aa8e34f4c 100644
--- a/src/cairo-xcb-private.h
+++ b/src/cairo-xcb-private.h
@@ -158,7 +158,6 @@ struct _cairo_xcb_screen {
} solid_cache[16];
int solid_cache_size;
- cairo_cache_t surface_pattern_cache;
cairo_cache_t linear_pattern_cache;
cairo_cache_t radial_pattern_cache;
cairo_freelist_t pattern_cache_entry_freelist;
@@ -298,14 +297,6 @@ cairo_private void
_cairo_xcb_screen_put_gc (cairo_xcb_screen_t *screen, int depth, xcb_gcontext_t gc);
cairo_private cairo_status_t
-_cairo_xcb_screen_store_surface_picture (cairo_xcb_screen_t *screen,
- cairo_surface_t *picture,
- unsigned int size);
-cairo_private void
-_cairo_xcb_screen_remove_surface_picture (cairo_xcb_screen_t *screen,
- cairo_surface_t *picture);
-
-cairo_private cairo_status_t
_cairo_xcb_screen_store_linear_picture (cairo_xcb_screen_t *screen,
const cairo_linear_pattern_t *linear,
cairo_surface_t *picture);