forked from AuroraMiddleware/gtk
configure.ac: Depend on cairo 1.14.0
This is needed for cairo_set_device_scale()
This commit is contained in:
parent
36fedb0c4b
commit
710f332082
@ -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 */
|
||||
|
||||
|
13
configure.ac
13
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"
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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 &&
|
||||
|
@ -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,
|
||||
|
@ -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 =
|
||||
|
@ -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 =
|
||||
|
@ -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 ();
|
||||
|
Loading…
Reference in New Issue
Block a user