From 4f3837c372c73dac31ab7995c59aa0f3069c15b4 Mon Sep 17 00:00:00 2001 From: Jeremie Knuesel Date: Mon, 12 Feb 2018 15:18:18 +0100 Subject: [PATCH] Remove Cairo 1.14 version checks They're no longer needed since GTK+ 3.22 depends on Cairo >= 1.14 --- zathura/page-widget.c | 8 -------- zathura/render.c | 6 ++---- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/zathura/page-widget.c b/zathura/page-widget.c index 5c1fc4b..0f95d2e 100644 --- a/zathura/page-widget.c +++ b/zathura/page-widget.c @@ -496,7 +496,6 @@ zathura_page_widget_get_property(GObject* object, guint prop_id, GValue* value, } } -#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,14,0) static zathura_device_factors_t get_safe_device_factors(cairo_surface_t* surface) { @@ -512,13 +511,6 @@ get_safe_device_factors(cairo_surface_t* surface) return factors; } -#else -static zathura_device_factors_t -get_safe_device_factors(cairo_surface_t* UNUSED(surface)) -{ - return (zathura_device_factors_t){1.0, 1.0}; -} -#endif static gboolean zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) diff --git a/zathura/render.c b/zathura/render.c index 0a85f45..1d7636c 100644 --- a/zathura/render.c +++ b/zathura/render.c @@ -747,20 +747,18 @@ render(render_job_t* job, ZathuraRenderRequest* request, ZathuraRenderer* render &page_height, &page_width, false); -#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,14,0) zathura_device_factors_t device_factors = zathura_document_get_device_factors(document); page_width *= device_factors.x; page_height *= device_factors.y; -#endif cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, page_width, page_height); if (surface == NULL) { return false; } -#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,14,0) + cairo_surface_set_device_scale(surface, device_factors.x, device_factors.y); -#endif + if (cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS) { cairo_surface_destroy(surface); return false;