summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-10-23 19:06:25 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2013-10-23 19:06:25 +0200
commit0ccfd9e707b6c0349321a9f640df27ac959007c7 (patch)
tree122b45ac011f53c93c26a70ac8ddf88f1ed9eb7b
parent24dec422ed037c51a15164feaf5fabdbe9b66b42 (diff)
Correctly tell cairo about CPU buffer access
We need to tell cairo to flush buffers before starting CPU access and afterwards mark it dirty. This is unlikely to be needed on mem-buffers, but we cannot rely on it so do it. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
-rw-r--r--src/wlt_render.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wlt_render.c b/src/wlt_render.c
index 4702e1c..819b807 100644
--- a/src/wlt_render.c
+++ b/src/wlt_render.c
@@ -289,9 +289,10 @@ void wlt_renderer_draw(const struct wlt_draw_ctx *ctx)
* cairo to blit it into the gtk buffer. This way we get two mem-writes
* but at least it's fast enough to render a whole screen. */
+ cairo_surface_flush(rend->surface);
tsm_screen_draw(ctx->screen, wlt_renderer_draw_cell, (void*)ctx);
+ cairo_surface_mark_dirty(rend->surface);
- /* TODO: mark surface as dirty so cairo notices that */
cairo_set_source_surface(ctx->cr, rend->surface, 0, 0);
cairo_paint(ctx->cr);
}