blob: e15643e8ac58c3b655323251319e99425913f167 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# HG changeset patch
# User Jonathan Kew <jkew@mozilla.com>
# Date 1714124453 -3600
# Fri Apr 26 10:40:53 2024 +0100
# Node ID 6d9a0fd66f0a4e02df968ea479d890a41031db15
# Parent e606a18e8d85eb481139530055d38f125665fb50
Bug 1892913 - patch 18 - Cairo fixes for iOS build.
diff --git a/gfx/cairo/cairo/src/cairo-features.h b/gfx/cairo/cairo/src/cairo-features.h
--- a/gfx/cairo/cairo/src/cairo-features.h
+++ b/gfx/cairo/cairo/src/cairo-features.h
@@ -75,6 +75,10 @@
#define CAIRO_HAS_QUARTZ_APPLICATION_SERVICES 1
#endif
+#if defined(MOZ_WIDGET_UIKIT)
+#define CAIRO_HAS_IMAGE_IO 1
+#endif
+
#ifdef XP_WIN
#define CAIRO_HAS_DWRITE_FONT 1
#define CAIRO_HAS_WIN32_FONT 1
diff --git a/gfx/cairo/cairo/src/cairo-quartz-image-surface.c b/gfx/cairo/cairo/src/cairo-quartz-image-surface.c
--- a/gfx/cairo/cairo/src/cairo-quartz-image-surface.c
+++ b/gfx/cairo/cairo/src/cairo-quartz-image-surface.c
@@ -307,7 +307,11 @@ cairo_quartz_image_surface_create (cairo
colorspace = _cairo_quartz_create_color_space (context);
}
else {
+#if CAIRO_HAS_QUARTZ_APPLICATION_SERVICES /* available on macOS but not iOS */
colorspace = CGDisplayCopyColorSpace (CGMainDisplayID ());
+#else
+ colorspace = CGColorSpaceCreateDeviceRGB ();
+#endif
}
bitinfo |= format == CAIRO_FORMAT_ARGB32 ? kCGImageAlphaPremultipliedFirst : kCGImageAlphaNoneSkipFirst;
diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c
--- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
+++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
@@ -201,8 +201,10 @@ CGColorSpaceRef
if (color_space)
return color_space;
}
+#if CAIRO_HAS_QUARTZ_APPLICATION_SERVICES /* available on macOS but not iOS */
if (!color_space)
color_space = CGDisplayCopyColorSpace (CGMainDisplayID ());
+#endif
if (!color_space)
color_space = CGColorSpaceCreateDeviceRGB ();
diff --git a/gfx/cairo/cairo/src/cairo-quartz.h b/gfx/cairo/cairo/src/cairo-quartz.h
--- a/gfx/cairo/cairo/src/cairo-quartz.h
+++ b/gfx/cairo/cairo/src/cairo-quartz.h
@@ -49,6 +49,10 @@
#include <ApplicationServices/ApplicationServices.h>
#endif
+#if CAIRO_HAS_IMAGE_IO
+#include <ImageIO/ImageIO.h>
+#endif
+
CAIRO_BEGIN_DECLS
cairo_public cairo_surface_t *
|