Remove Cairo 1.14 version checks

They're no longer needed since GTK+ 3.22 depends on Cairo >= 1.14
This commit is contained in:
Jeremie Knuesel 2018-02-12 15:18:18 +01:00
parent 1a12214a8c
commit 4f3837c372
2 changed files with 2 additions and 12 deletions

View file

@ -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)

View file

@ -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;