From ea65e189c3245f69df5b1c334695970c2792da0c Mon Sep 17 00:00:00 2001 From: marcoe Date: Tue, 4 Jul 2023 13:14:07 +0200 Subject: [PATCH] remove unneeded cairo save and restore Cairo frees its "saved state stack" automatically on a call to `cairo_destroy()`. --- zathura/render.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/zathura/render.c b/zathura/render.c index 04de23d..6796aea 100644 --- a/zathura/render.c +++ b/zathura/render.c @@ -775,7 +775,6 @@ render_to_cairo_surface(cairo_surface_t* surface, zathura_page_t* page, ZathuraR cairo_set_source_rgb(cairo, 1, 1, 1); cairo_paint(cairo); cairo_restore(cairo); - cairo_save(cairo); /* apply scale (used by e.g. Poppler as pixels per point) */ if (fabs(real_scale - 1.0f) > FLT_EPSILON) { @@ -785,7 +784,6 @@ render_to_cairo_surface(cairo_surface_t* surface, zathura_page_t* page, ZathuraR zathura_renderer_lock(renderer); const int err = zathura_page_render(page, cairo, false); zathura_renderer_unlock(renderer); - cairo_restore(cairo); cairo_destroy(cairo); return err == ZATHURA_ERROR_OK;