2 commits - meson.build src/cairo-image-surface.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 21 11:53:55 UTC 2024


 meson.build               |    3 +++
 src/cairo-image-surface.c |    5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 425b4c8347f78562e030a9b8b4c83e08f48416d7
Merge: 54cbe5148 3d4648536
Author: Emmanuele Bassi <ebassi at gmail.com>
Date:   Tue May 21 11:53:53 2024 +0000

    Merge branch 'fix-pixman-enum' into 'master'
    
    Only use PIXMAN_r8g8b8_sRGB if available
    
    See merge request cairo/cairo!552

commit 3d46485365944c6533991553e6af4c3920670a85
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Tue May 21 19:47:55 2024 +0930

    Only use PIXMAN_r8g8b8_sRGB if available
    
    Pixman 0.42.3 added PIXMAN_r8g8b8_sRGB to pixman_format_code_t. CI
    fails if it is missing from switch statements. Building with pixman <
    0.42.3 will fail if the enum is used. So put it in a versioned #if.

diff --git a/meson.build b/meson.build
index 03eb140f0..b2ab02b66 100644
--- a/meson.build
+++ b/meson.build
@@ -643,6 +643,9 @@ pixman_dep = dependency('pixman-1',
 if pixman_dep.found()
   feature_conf.set('CAIRO_HAS_IMAGE_SURFACE', 1)
   conf.set('HAS_PIXMAN_GLYPHS', 1)
+  if pixman_dep.version().version_compare('>= 0.42.3')
+    conf.set('HAS_PIXMAN_r8g8b8_sRGB', 1)
+  endif
   if pixman_dep.type_name() == 'internal'
     internal_deps += [pixman_dep]
   else
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index 1691aa14e..32d8a8c38 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -110,7 +110,10 @@ _cairo_format_from_pixman_format (pixman_format_code_t pixman_format)
     case PIXMAN_r5g6b5:
 	return CAIRO_FORMAT_RGB16_565;
     case PIXMAN_r8g8b8a8: case PIXMAN_r8g8b8x8:
-    case PIXMAN_a8r8g8b8_sRGB: case PIXMAN_r8g8b8_sRGB:
+    case PIXMAN_a8r8g8b8_sRGB:
+#if HAS_PIXMAN_r8g8b8_sRGB
+    case PIXMAN_r8g8b8_sRGB:
+#endif
     case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8: case PIXMAN_r8g8b8:
     case PIXMAN_b8g8r8:   case PIXMAN_b5g6r5:
     case PIXMAN_a1r5g5b5: case PIXMAN_x1r5g5b5: case PIXMAN_a1b5g5r5:


More information about the cairo-commit mailing list