pixman: Branch 'master' - 4 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sun Feb 20 17:50:41 UTC 2022
.gitlab-ci.yml | 2 +-
configure.ac | 6 +++---
demos/dither.c | 36 +++++++++++++++++-------------------
demos/gtk-utils.c | 10 +++-------
demos/scale.c | 28 +++++++++++++---------------
meson.build | 7 +++----
pixman/meson.build | 9 +--------
7 files changed, 41 insertions(+), 57 deletions(-)
New commits:
commit 285b9a907caffeb979322e629d4e57aa42061b5a
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date: Sat Feb 19 13:37:54 2022 -0800
configure: replace bugzilla URL with gitlab issues
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
diff --git a/configure.ac b/configure.ac
index 4b12898..3e84182 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1182,7 +1182,7 @@ m4_if(m4_eval(pixman_minor % 2), [1], [
echo
echo " or by filing a bug at "
echo
- echo " https://bugs.freedesktop.org/enter_bug.cgi?product=pixman "
+ echo " https://gitlab.freedesktop.org/pixman/pixman/-/issues/new "
echo
echo " If you are looking for a stable release of pixman, please note "
echo " that stable releases have _even_ minor version numbers. Ie., "
commit adc07d46188920806e32366917d00599fb183a5a
Author: Nirbheek Chauhan <nirbheek at centricular.com>
Date: Fri Jan 21 12:39:30 2022 +0530
meson: Fix usage of pkgconfig.generate()
The library that the pkgconfig file is for should be the first
positional argument. The `libraries:` kwarg is for libraries that the
user must also link against, and which meson does not know about (and
hence cannot automatically add to the `Libs:` or `Requires:` section
in the .pc file).
Fixes:
```
subprojects/pixman/meson.build:564: DEPRECATION: Library pixman-1 was
passed to the "libraries" keyword argument of a previous call to
generate() method instead of first positional argument. Adding
pixman-1 to "Requires" field, but this is a deprecated behaviour that
will change in a future version of Meson. Please report the issue if
this warning cannot be avoided in your case.
```
diff --git a/meson.build b/meson.build
index bf270ce..58a1406 100644
--- a/meson.build
+++ b/meson.build
@@ -555,11 +555,10 @@ if not get_option('tests').disabled()
endif
pkg = import('pkgconfig')
-pkg.generate(
+pkg.generate(libpixman,
name : 'Pixman',
filebase : 'pixman-1',
description : 'The pixman library (version 1)',
- libraries : libpixman,
subdirs: 'pixman-1',
version : meson.project_version(),
)
commit 3563dfe436da023a5151857ba474b5a19faba3e6
Author: Nirbheek Chauhan <nirbheek at centricular.com>
Date: Sun Jan 9 17:10:15 2022 +0530
meson: Fix warning about extract_all_objects usage
We use this because of a meson bug that was fixed in 0.52:
https://mesonbuild.com/Release-notes-for-0-52-0.html#improved-support-for-static-libraries
Bump the requirement and remove the extract_all_objects workaround.
This gets rid of a meson warning:
WARNING: extract_all_objects called without setting recursive
keyword argument. Meson currently defaults to
non-recursive to maintain backward compatibility but
the default will be changed in the future.
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e850b76..25c73df 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -14,6 +14,6 @@ meson-build:
- dnf -y groupinstall buildsys-build
- dnf -y builddep pixman
- dnf -y install ninja-build
- - python3 -m pip install meson>=0.47.2
+ - python3 -m pip install meson>=0.52.1
- meson build
- ninja -C build test
diff --git a/meson.build b/meson.build
index 6ab6a97..bf270ce 100644
--- a/meson.build
+++ b/meson.build
@@ -23,7 +23,7 @@ project(
['c'],
version : '0.40.1',
license : 'MIT',
- meson_version : '>= 0.50.0',
+ meson_version : '>= 0.52.0',
default_options : ['buildtype=debugoptimized'],
)
diff --git a/pixman/meson.build b/pixman/meson.build
index 0f1ac6f..1c2e7d3 100644
--- a/pixman/meson.build
+++ b/pixman/meson.build
@@ -117,17 +117,10 @@ if cpu_features_path != ''
cpu_features_inc = include_directories(cpu_features_path)
endif
-# We cannot use 'link_with' or 'link_whole' because meson wont do the right
-# thing for static archives.
-_obs = []
-foreach l : pixman_simd_libs
- _obs += l.extract_all_objects()
-endforeach
-
libpixman = library(
'pixman-1',
[pixman_files, config_h, version_h, cpu_features_sources],
- objects : _obs,
+ link_with: pixman_simd_libs,
c_args : libpixman_extra_cargs,
dependencies : [dep_m, dep_threads],
include_directories : cpu_features_inc,
commit c6e1af995e3b2af2044faf1b815dc5323af7c691
Author: Manuel Stoeckl <code at mstoeckl.com>
Date: Sun Oct 10 21:29:15 2021 -0400
demos: port to Gtk3
GTK2 has reached end of life, and GTK3 has been available for a
almost a decade.
Signed-off-by: Manuel Stoeckl <code at mstoeckl.com>
Reviewed-by: Simon Ser <contact at emersion.fr>
diff --git a/configure.ac b/configure.ac
index 9db0131..4b12898 100644
--- a/configure.ac
+++ b/configure.ac
@@ -892,7 +892,7 @@ PKG_PROG_PKG_CONFIG
if test $enable_gtk = yes ; then
AC_CHECK_LIB([pixman-1], [pixman_version_string])
- PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.16 pixman-1])
+ PKG_CHECK_MODULES(GTK, [gtk+-3.0 pixman-1])
fi
if test $enable_gtk = auto ; then
@@ -900,7 +900,7 @@ if test $enable_gtk = auto ; then
fi
if test $enable_gtk = auto ; then
- PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.16 pixman-1], [enable_gtk=yes], [enable_gtk=no])
+ PKG_CHECK_MODULES(GTK, [gtk+-3.0 pixman-1], [enable_gtk=yes], [enable_gtk=no])
fi
AM_CONDITIONAL(HAVE_GTK, [test "x$enable_gtk" = xyes])
diff --git a/demos/dither.c b/demos/dither.c
index d72c250..2ab8270 100644
--- a/demos/dither.c
+++ b/demos/dither.c
@@ -103,48 +103,46 @@ rescale (GtkWidget *may_be_null, app_t *app)
}
static gboolean
-on_expose (GtkWidget *da, GdkEvent *event, gpointer data)
+on_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
{
- app_t *app = data;
- GdkRectangle *area = &event->expose.area;
+ app_t *app = user_data;
+ GdkRectangle area;
cairo_surface_t *surface;
pixman_image_t *tmp, *final;
- cairo_t *cr;
uint32_t *pixels;
+ gdk_cairo_get_clip_rectangle(cr, &area);
+
tmp = pixman_image_create_bits (
- app->format, area->width, area->height, NULL, 0);
+ app->format, area.width, area.height, NULL, 0);
pixman_image_set_dither (tmp, app->dither);
pixman_image_composite (
PIXMAN_OP_SRC,
app->original, NULL, tmp,
- area->x, area->y, 0, 0, 0, 0,
- app->width - area->x,
- app->height - area->y);
+ area.x, area.y, 0, 0, 0, 0,
+ app->width - area.x,
+ app->height - area.y);
- pixels = calloc (1, area->width * area->height * 4);
+ pixels = calloc (1, area.width * area.height * 4);
final = pixman_image_create_bits (
- PIXMAN_a8r8g8b8, area->width, area->height, pixels, area->width * 4);
+ PIXMAN_a8r8g8b8, area.width, area.height, pixels, area.width * 4);
pixman_image_composite (
PIXMAN_OP_SRC,
tmp, NULL, final,
- area->x, area->y, 0, 0, 0, 0,
- app->width - area->x,
- app->height - area->y);
+ area.x, area.y, 0, 0, 0, 0,
+ app->width - area.x,
+ app->height - area.y);
surface = cairo_image_surface_create_for_data (
(uint8_t *)pixels, CAIRO_FORMAT_ARGB32,
- area->width, area->height, area->width * 4);
-
- cr = gdk_cairo_create (da->window);
+ area.width, area.height, area.width * 4);
- cairo_set_source_surface (cr, surface, area->x, area->y);
+ cairo_set_source_surface (cr, surface, area.x, area.y);
cairo_paint (cr);
- cairo_destroy (cr);
cairo_surface_destroy (surface);
free (pixels);
pixman_image_unref (final);
@@ -211,7 +209,7 @@ app_new (pixman_image_t *original)
g_error ("Could not read file dither.ui: %s", err->message);
widget = get_widget (app, "drawing_area");
- g_signal_connect (widget, "expose_event", G_CALLBACK (on_expose), app);
+ g_signal_connect (widget, "draw", G_CALLBACK (on_draw), app);
set_up_combo_box (app, "target_format_combo_box",
G_N_ELEMENTS (formats), formats);
diff --git a/demos/gtk-utils.c b/demos/gtk-utils.c
index 32d4aec..b3a60ff 100644
--- a/demos/gtk-utils.c
+++ b/demos/gtk-utils.c
@@ -93,15 +93,14 @@ pixbuf_from_argb32 (uint32_t *bits,
}
static gboolean
-on_expose (GtkWidget *widget, GdkEventExpose *expose, gpointer data)
+on_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
{
- pixman_image_t *pimage = data;
+ pixman_image_t *pimage = user_data;
int width = pixman_image_get_width (pimage);
int height = pixman_image_get_height (pimage);
int stride = pixman_image_get_stride (pimage);
cairo_surface_t *cimage;
cairo_format_t format;
- cairo_t *cr;
if (pixman_image_get_format (pimage) == PIXMAN_x8r8g8b8)
format = CAIRO_FORMAT_RGB24;
@@ -111,14 +110,11 @@ on_expose (GtkWidget *widget, GdkEventExpose *expose, gpointer data)
cimage = cairo_image_surface_create_for_data (
(uint8_t *)pixman_image_get_data (pimage),
format, width, height, stride);
-
- cr = gdk_cairo_create (widget->window);
cairo_rectangle (cr, 0, 0, width, height);
cairo_set_source_surface (cr, cimage, 0, 0);
cairo_fill (cr);
- cairo_destroy (cr);
cairo_surface_destroy (cimage);
return TRUE;
@@ -170,7 +166,7 @@ show_image (pixman_image_t *image)
break;
}
- g_signal_connect (window, "expose_event", G_CALLBACK (on_expose), copy);
+ g_signal_connect (window, "draw", G_CALLBACK (on_draw), copy);
g_signal_connect (window, "delete_event", G_CALLBACK (gtk_main_quit), NULL);
gtk_widget_show (window);
diff --git a/demos/scale.c b/demos/scale.c
index 0995ad0..7459a5c 100644
--- a/demos/scale.c
+++ b/demos/scale.c
@@ -278,39 +278,37 @@ rescale (GtkWidget *may_be_null, app_t *app)
}
static gboolean
-on_expose (GtkWidget *da, GdkEvent *event, gpointer data)
+on_draw (GtkWidget *widget, cairo_t *cr, gpointer user_data)
{
- app_t *app = data;
- GdkRectangle *area = &event->expose.area;
+ app_t *app = user_data;
+ GdkRectangle area;
cairo_surface_t *surface;
pixman_image_t *tmp;
- cairo_t *cr;
uint32_t *pixels;
- pixels = calloc (1, area->width * area->height * 4);
+ gdk_cairo_get_clip_rectangle(cr, &area);
+
+ pixels = calloc (1, area.width * area.height * 4);
tmp = pixman_image_create_bits (
- PIXMAN_a8r8g8b8, area->width, area->height, pixels, area->width * 4);
+ PIXMAN_a8r8g8b8, area.width, area.height, pixels, area.width * 4);
- if (area->x < app->scaled_width && area->y < app->scaled_height)
+ if (area.x < app->scaled_width && area.y < app->scaled_height)
{
pixman_image_composite (
PIXMAN_OP_SRC,
app->original, NULL, tmp,
- area->x, area->y, 0, 0, 0, 0,
- app->scaled_width - area->x, app->scaled_height - area->y);
+ area.x, area.y, 0, 0, 0, 0,
+ app->scaled_width - area.x, app->scaled_height - area.y);
}
surface = cairo_image_surface_create_for_data (
(uint8_t *)pixels, CAIRO_FORMAT_ARGB32,
- area->width, area->height, area->width * 4);
-
- cr = gdk_cairo_create (da->window);
+ area.width, area.height, area.width * 4);
- cairo_set_source_surface (cr, surface, area->x, area->y);
+ cairo_set_source_surface (cr, surface, area.x, area.y);
cairo_paint (cr);
- cairo_destroy (cr);
cairo_surface_destroy (surface);
free (pixels);
pixman_image_unref (tmp);
@@ -400,7 +398,7 @@ app_new (pixman_image_t *original)
gtk_scale_add_mark (GTK_SCALE (widget), 0.0, GTK_POS_LEFT, NULL);
widget = get_widget (app, "drawing_area");
- g_signal_connect (widget, "expose_event", G_CALLBACK (on_expose), app);
+ g_signal_connect (widget, "draw", G_CALLBACK (on_draw), app);
set_up_filter_box (app, "reconstruct_x_combo_box");
set_up_filter_box (app, "reconstruct_y_combo_box");
diff --git a/meson.build b/meson.build
index 831f9eb..6ab6a97 100644
--- a/meson.build
+++ b/meson.build
@@ -412,7 +412,7 @@ else
dep_openmp = null_dep
endif
-dep_gtk = dependency('gtk+-2.0', version : '>= 2.16', required : get_option('gtk'))
+dep_gtk = dependency('gtk+-3.0', required : get_option('gtk'))
dep_glib = dependency('glib-2.0', required : get_option('gtk'))
dep_png = null_dep
More information about the xorg-commit
mailing list