diff options
author | Javier Jardón <jjardon@gnome.org> | 2014-10-25 20:23:16 +0100 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2014-11-10 15:12:17 +0000 |
commit | 710f3320827b437bbcf4292203439a16e5117813 (patch) | |
tree | 4985598b1d694f03776bf2fbc1503d2f01e8e9f5 | |
parent | 36fedb0c4b373272afc2d76a7c790d696ed48034 (diff) | |
download | gtk+-710f3320827b437bbcf4292203439a16e5117813.tar.gz |
configure.ac: Depend on cairo 1.14.0
This is needed for cairo_set_device_scale()
-rw-r--r-- | config.h.win32.in | 3 | ||||
-rw-r--r-- | configure.ac | 13 | ||||
-rw-r--r-- | gdk/gdkcursor.c | 2 | ||||
-rw-r--r-- | gdk/gdkgl.c | 4 | ||||
-rw-r--r-- | gdk/gdkwindow.c | 10 | ||||
-rw-r--r-- | gdk/wayland/gdkcursor-wayland.c | 10 | ||||
-rw-r--r-- | gdk/wayland/gdkdisplay-wayland.c | 2 | ||||
-rw-r--r-- | gdk/wayland/gdkwindow-wayland.c | 7 | ||||
-rw-r--r-- | gdk/x11/gdkcursor-x11.c | 4 | ||||
-rw-r--r-- | gdk/x11/gdkdisplay-x11.c | 5 | ||||
-rw-r--r-- | gdk/x11/gdkglcontext-x11.c | 2 | ||||
-rw-r--r-- | gdk/x11/gdkscreen-x11.c | 4 | ||||
-rw-r--r-- | gdk/x11/gdkwindow-x11.c | 4 | ||||
-rw-r--r-- | gtk/gtkcssshadowvalue.c | 4 | ||||
-rw-r--r-- | gtk/gtkdnd.c | 2 | ||||
-rw-r--r-- | gtk/gtkiconhelper.c | 2 | ||||
-rw-r--r-- | gtk/inspector/visual.c | 4 |
17 files changed, 7 insertions, 75 deletions
diff --git a/config.h.win32.in b/config.h.win32.in index 8674291207..1cfb8e93e7 100644 --- a/config.h.win32.in +++ b/config.h.win32.in @@ -23,9 +23,6 @@ /* Define to 1 if you have the `bind_textdomain_codeset' function. */ #define HAVE_BIND_TEXTDOMAIN_CODESET 1 -/* Define to 1 if you have the `cairo_surface_set_device_scale' function. */ -/* #undef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE */ - /* define if we have colord */ /* #undef HAVE_COLORD */ diff --git a/configure.ac b/configure.ac index 7c78d52ad7..d8105127d7 100644 --- a/configure.ac +++ b/configure.ac @@ -44,7 +44,7 @@ m4_define([gtk_binary_version], [3.0.0]) m4_define([glib_required_version], [2.43.0]) m4_define([pango_required_version], [1.36.7]) m4_define([atk_required_version], [2.15.1]) -m4_define([cairo_required_version], [1.12.0]) +m4_define([cairo_required_version], [1.14.0]) m4_define([gdk_pixbuf_required_version], [2.30.0]) m4_define([introspection_required_version], [1.39.0]) m4_define([wayland_required_version], [1.5.91]) @@ -1342,17 +1342,6 @@ else LIBS="$gtk_save_LIBS" fi -# Check for cairo_set_device_scale, as we don't want to depend hard on -# this until there is a stable release with it -CAIRO_CFLAGS=`$PKG_CONFIG --cflags cairo` -CAIRO_LIBS=`$PKG_CONFIG --libs cairo` -CFLAGS="$CFLAGS $CAIRO_CFLAGS" -gtk_save_LIBS="$LIBS" -LIBS="$CAIRO_LIBS $LIBS" -AC_CHECK_FUNCS(cairo_surface_set_device_scale) -LIBS="$gtk_save_LIBS" - - CFLAGS="$saved_cflags" LDFLAGS="$saved_ldflags" diff --git a/gdk/gdkcursor.c b/gdk/gdkcursor.c index a9306e0782..ae8b3a643d 100644 --- a/gdk/gdkcursor.c +++ b/gdk/gdkcursor.c @@ -450,9 +450,7 @@ gdk_cursor_get_image (GdkCursor *cursor) h = cairo_image_surface_get_height (surface); x_scale = y_scale = 1; -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_get_device_scale (surface, &x_scale, &y_scale); -#endif pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, w, h); cairo_surface_destroy (surface); diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c index 152941166f..3465508c57 100644 --- a/gdk/gdkgl.c +++ b/gdk/gdkgl.c @@ -596,9 +596,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr, (alpha_size == 0) ? CAIRO_FORMAT_RGB24 : CAIRO_FORMAT_ARGB32, width, height); -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_set_device_scale (image, buffer_scale, buffer_scale); -#endif framebuffer = paint_data->tmp_framebuffer; glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, framebuffer); @@ -677,9 +675,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface, window_height = gdk_window_get_height (window); sx = sy = 1; -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_get_device_scale (window->current_paint.surface, &sx, &sy); -#endif cairo_surface_get_device_offset (surface, &device_x_offset, &device_y_offset); diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index ca7632a75f..7d85b76ef4 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -2945,9 +2945,7 @@ gdk_window_begin_paint_region (GdkWindow *window, MAX (clip_box.width, 1), MAX (clip_box.height, 1)); sx = sy = 1; -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_get_device_scale (window->current_paint.surface, &sx, &sy); -#endif cairo_surface_set_device_offset (window->current_paint.surface, -clip_box.x*sx, -clip_box.y*sy); gdk_cairo_surface_mark_as_direct (window->current_paint.surface, window); @@ -9457,9 +9455,7 @@ gdk_window_create_similar_surface (GdkWindow * window, window_surface = gdk_window_ref_impl_surface (window); sx = sy = 1; -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_get_device_scale (window_surface, &sx, &sy); -#endif switch (_gdk_rendering_mode) { @@ -9467,18 +9463,14 @@ gdk_window_create_similar_surface (GdkWindow * window, { cairo_rectangle_t rect = { 0, 0, width * sx, height *sy }; surface = cairo_recording_surface_create (content, &rect); -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_set_device_scale (surface, sx, sy); -#endif } break; case GDK_RENDERING_MODE_IMAGE: surface = cairo_image_surface_create (content == CAIRO_CONTENT_COLOR ? CAIRO_FORMAT_RGB24 : content == CAIRO_CONTENT_ALPHA ? CAIRO_FORMAT_A8 : CAIRO_FORMAT_ARGB32, width * sx, height * sy); -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_set_device_scale (surface, sx, sy); -#endif break; case GDK_RENDERING_MODE_SIMILAR: default: @@ -9556,12 +9548,10 @@ gdk_window_create_similar_image_surface (GdkWindow * window, cairo_surface_destroy (window_surface); } -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE if (scale == 0) scale = gdk_window_get_scale_factor (window); cairo_surface_set_device_scale (surface, scale, scale); -#endif return surface; } diff --git a/gdk/wayland/gdkcursor-wayland.c b/gdk/wayland/gdkcursor-wayland.c index 38a8dbb2d7..c350b03c19 100644 --- a/gdk/wayland/gdkcursor-wayland.c +++ b/gdk/wayland/gdkcursor-wayland.c @@ -308,13 +308,9 @@ _gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display, if (surface) { -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE - { - double sx, sy; - cairo_surface_get_device_scale (surface, &sx, &sy); - cursor->surface.scale = (int)sx; - } -#endif + double sx, sy; + cairo_surface_get_device_scale (surface, &sx, &sy); + cursor->surface.scale = (int)sx; cursor->surface.width = cairo_image_surface_get_width (surface); cursor->surface.height = cairo_image_surface_get_height (surface); } diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c index 56e7278ee2..2bb1aaddb1 100644 --- a/gdk/wayland/gdkdisplay-wayland.c +++ b/gdk/wayland/gdkdisplay-wayland.c @@ -800,9 +800,7 @@ _gdk_wayland_display_create_shm_surface (GdkWaylandDisplay *display, cairo_surface_set_user_data (surface, &gdk_wayland_cairo_key, data, gdk_wayland_cairo_surface_destroy); -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_set_device_scale (surface, scale, scale); -#endif status = cairo_surface_status (surface); if (status != CAIRO_STATUS_SUCCESS) diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index a7e23b52d8..e44125ad35 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -217,9 +217,7 @@ _gdk_wayland_screen_create_root_window (GdkScreen *screen, impl->scale, impl->scale); -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_set_device_scale (impl->cairo_surface, impl->scale, impl->scale); -#endif window->window_type = GDK_WINDOW_ROOT; window->depth = 32; @@ -420,11 +418,6 @@ window_update_scale (GdkWindow *window) scale = MAX (scale, output_scale); } -#ifndef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE - /* Don't announce a scale if we can't support it */ - scale = 1; -#endif - if (scale != impl->scale) { impl->scale = scale; diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c index 43ae9fc695..7ed4681064 100644 --- a/gdk/x11/gdkcursor-x11.c +++ b/gdk/x11/gdkcursor-x11.c @@ -524,9 +524,7 @@ get_surface_size (cairo_surface_t *surface, x_scale = y_scale = 1; -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_get_device_scale (surface, &x_scale, &y_scale); -#endif /* Assume any set scaling is icon scale */ *width = @@ -562,9 +560,7 @@ create_cursor_image (cairo_surface_t *source_surface, height, width * 4); -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_set_device_scale (surface, scale, scale); -#endif cr = cairo_create (surface); cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 4799bc6b5a..2ebbed9953 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -2707,11 +2707,6 @@ gdk_x11_display_set_window_scale (GdkDisplay *display, scale = MAX (scale, 1); -#ifndef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE - /* Without cairo support we can't support any scale but 1 */ - scale = 1; -#endif - x11_screen = GDK_X11_SCREEN (GDK_X11_DISPLAY (display)->screen); if (!x11_screen->fixed_window_scale) diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c index b545f28c7d..847a2adb6f 100644 --- a/gdk/x11/gdkglcontext-x11.c +++ b/gdk/x11/gdkglcontext-x11.c @@ -469,9 +469,7 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context, window_height = gdk_window_get_height (window); sx = sy = 1; -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_get_device_scale (window->current_paint.surface, &sx, &sy); -#endif cairo_surface_get_device_offset (surface, &device_x_offset, &device_y_offset); diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c index e700213005..5c71c538a7 100644 --- a/gdk/x11/gdkscreen-x11.c +++ b/gdk/x11/gdkscreen-x11.c @@ -1128,11 +1128,7 @@ _gdk_x11_screen_new (GdkDisplay *display, /* we want this to be always non-null */ x11_screen->window_manager_name = g_strdup ("unknown"); -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE scale_str = g_getenv ("GDK_SCALE"); -#else - scale_str = "1"; -#endif if (scale_str) { x11_screen->fixed_window_scale = TRUE; diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index c2d7cf7387..ec4eead362 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -467,9 +467,7 @@ gdk_x11_ref_cairo_surface (GdkWindow *window) impl->cairo_surface = gdk_x11_create_cairo_surface (impl, gdk_window_get_width (window) * impl->window_scale, gdk_window_get_height (window) * impl->window_scale); -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_set_device_scale (impl->cairo_surface, impl->window_scale, impl->window_scale); -#endif if (WINDOW_IS_TOPLEVEL (window) && impl->toplevel->in_frame) hook_surface_changed (window); @@ -2961,9 +2959,7 @@ gdk_window_x11_set_background (GdkWindow *window, cairo_surface_get_device_offset (surface, &x, &y); sx = sy = 1.; -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_get_device_scale (surface, &sx, &sy); -#endif /* XXX: This still bombs for non-pixmaps, but there's no way to * detect we're not a pixmap in Cairo... */ if (x == 0.0 && y == 0.0 && diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c index 8b5ea9f3d1..d3847ba627 100644 --- a/gtk/gtkcssshadowvalue.c +++ b/gtk/gtkcssshadowvalue.c @@ -431,9 +431,7 @@ make_blurred_pango_surface (cairo_t *existing_cr, pango_layout_get_pixel_extents (layout, &ink_rect, NULL); clip_radius = _gtk_cairo_blur_compute_pixels (radius); x_scale = y_scale = 1; -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE - cairo_surface_get_device_scale (cairo_get_target (existing_cr), &x_scale, &y_scale); -#endif + cairo_surface_get_device_scale (cairo_get_target (existing_cr), &x_scale, &y_scale); surface = cairo_surface_create_similar_image (cairo_get_target (existing_cr), CAIRO_FORMAT_A8, diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index 50914e276e..3f16f9417f 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -844,9 +844,7 @@ get_surface_size (cairo_surface_t *surface, x_scale = y_scale = 1; -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_get_device_scale (surface, &x_scale, &y_scale); -#endif /* Assume any set scaling is icon scale */ *width = diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c index 2fc97d106c..741b426da8 100644 --- a/gtk/gtkiconhelper.c +++ b/gtk/gtkiconhelper.c @@ -335,9 +335,7 @@ get_surface_size (GtkIconHelper *self, { x_scale = y_scale = 1; -#ifdef HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE cairo_surface_get_device_scale (surface, &x_scale, &y_scale); -#endif /* Assume any set scaling is icon scale */ *width = diff --git a/gtk/inspector/visual.c b/gtk/inspector/visual.c index 1a74ad08e0..8c10ff5aa7 100644 --- a/gtk/inspector/visual.c +++ b/gtk/inspector/visual.c @@ -363,7 +363,7 @@ init_font (GtkInspectorVisual *vis) G_BINDING_BIDIRECTIONAL|G_BINDING_SYNC_CREATE); } -#if defined (GDK_WINDOWING_X11) && defined (HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE) +#if defined (GDK_WINDOWING_X11) static void scale_changed (GtkAdjustment *adjustment, GtkInspectorVisual *vis) { @@ -379,7 +379,7 @@ scale_changed (GtkAdjustment *adjustment, GtkInspectorVisual *vis) static void init_scale (GtkInspectorVisual *vis) { -#if defined (GDK_WINDOWING_X11) && defined (HAVE_CAIRO_SURFACE_SET_DEVICE_SCALE) +#if defined (GDK_WINDOWING_X11) GdkScreen *screen; screen = gdk_screen_get_default (); |