Commit graph

13032 commits

Author SHA1 Message Date
Ryan VanderMeulen
ef42ed0ec8 Add check for clang to cairo attribute handling code 2025-07-01 12:14:08 -04:00
Tim-Philipp Müller
0bf0265009 Merge branch 'compiler-features' into 'master'
Rework compiler features detection

See merge request cairo/cairo!627
2025-07-01 12:32:05 +00:00
Tim-Philipp Müller
b09fe42db5 Merge branch 'ci-update-for-removal-of-old-intel-mac-runners' into 'master'
ci: remove macos job that used ancient intel mac mini runners

See merge request cairo/cairo!630
2025-06-25 11:00:33 +00:00
Tim-Philipp Müller
1fa0aebad1 ci: remove macos job that used ancient intel mac mini runners
The old intel mac mini runners are being retired and are no
longer available.

A job that uses the new arm64 mac runners will be added in !498.
2025-06-25 11:14:17 +01:00
Tim-Philipp Müller
abb37e2d02 Merge branch 'fixes' into 'master'
Win32: Fix init once condition

See merge request cairo/cairo!628
2025-06-19 09:03:09 +00:00
Luca Bacci
d4f1ba74d0 Win32: Fix init once condition
Fixes !626
2025-06-19 10:15:37 +02:00
Tim-Philipp Müller
3ffb6d5c07 Merge branch 'win32-fixes' into 'master'
Win32 Fixes

Closes #897

See merge request cairo/cairo!626
2025-06-16 17:15:07 +00:00
Luca Bacci
51be2591fe Meson: Define _CRT_SECURE_NO_WARNINGS when compiling with MSVC 2025-06-16 19:10:07 +02:00
Luca Bacci
481c6c78bd Meson: Suppress warning C5286 on MSVC
This happens when converting _cairo_status to _cairo_int_status:

  warning C5286: implicit conversion from enum type '_cairo_int_status' to
  enum type '_cairo_status'; use an explicit cast to silence this warning
2025-06-16 19:01:58 +02:00
Luca Bacci
cc51930a32 Meson: Add arguments for both C and C++ compilation
C++ compilation is used on Windows
2025-06-16 18:58:00 +02:00
Luca Bacci
6989158f4c Drop support for very old GCC versions
They don't support C11 anyway. Additionally, CLang defines a very
conservative __GNUC__ value (which is also configurable via the
-fgnuc-version= command-line argument)
2025-06-16 18:52:39 +02:00
Luca Bacci
ff4f2f4301 Win32: Implement init_once with InitOnceBeginInitialize / InitOnceComplete 2025-06-16 18:50:13 +02:00
Luca Bacci
ec2e879e0d Meson: Add comment about atomic ops on Windows 2025-06-16 18:49:36 +02:00
Luca Bacci
ee554c8610 DWrite: Fix switch for grid-fit mode
Ooops!
2025-06-16 17:52:15 +02:00
Luca Bacci
d9a11c3736 Win32: Use cairo_atomic_once_t to initialize TLS slot
We were using the double-checked locking pattern, which requires
memory fences to be safe on architectures with weak memory
guarantess (e.g ARM64)

Fixes https://gitlab.freedesktop.org/cairo/cairo/-/issues/897
2025-06-16 17:51:53 +02:00
Uli Schlachter
a3ca983ec3 Merge branch 'cm/fix-uaf-warning' into 'master'
xcb: Fix a -Wuse-after-free=3 warning with GCC

Closes #898

See merge request cairo/cairo!623
2025-05-27 16:02:14 +00:00
correctmost
a1c31f5ed5 xcb: Fix a -Wuse-after-free=3 warning with GCC
Closes #898
2025-05-26 21:20:15 -04:00
Uli Schlachter
2e2080247f Merge branch 'fix-symbol-interposition' into 'master'
Fix cairo-fdr and cairo-trace

See merge request cairo/cairo!608
2025-05-01 05:57:15 +00:00
Tim-Philipp Müller
7fd0cd0a9c Merge branch 'alatiera/android-image-test' into 'master'
ci: update the android CI image

See merge request cairo/cairo!614
2025-03-26 11:45:58 +00:00
Tim-Philipp Müller
20503ecec3 ci: drop placeholder-job tags from image jobs 2025-03-26 10:24:11 +00:00
Jordan Petridis
8dc09a1c48 ci: Update rust version 2025-03-26 10:18:13 +00:00
Jordan Petridis
0826837e4a ci: Install android toolchain into our own image
Previously we were using a prebuilt image from
gstreamer, but now we can copy what's needed and build
our own image with ci-templates.
2025-03-26 10:18:13 +00:00
Jordan Petridis
3a3771f862 ci: Update the android CI image
Switch to using the gstreamer/cerbero image that
has NDK installed, until we add the android toolchain
to our image.

Followup to 92dde935d4
2025-03-26 10:18:13 +00:00
Jordan Petridis
6dd779677e build: Update wrap files 2025-03-26 10:18:13 +00:00
Jordan Petridis
8c67cb8e2d ci: Move the android cross file into the repository
Avoid having the txt file be inline bash which is inline
in yaml in the ci config.
2025-03-26 10:18:13 +00:00
Tim-Philipp Müller
58578a2f48 Merge branch 'ci-windows-image-to-gstreamer-1.26' into 'master'
ci: update windows image

See merge request cairo/cairo!615
2025-03-12 20:09:45 +00:00
Tim-Philipp Müller
e4add32e19 ci: mark fedora image job as "placeholder job"
Which will make it start faster, and 99% of the time it
will finish in seconds.
2025-03-12 18:19:13 +01:00
Tim-Philipp Müller
1e2e54123d ci: update windows image 2025-03-12 18:06:31 +01:00
Emmanuele Bassi
c1bc9cd321 Merge branch 'release-1-18-4' into 'master'
Release Cairo 1.18.4

See merge request cairo/cairo!613
2025-03-08 14:05:21 +00:00
Emmanuele Bassi
22206ba5dd Post-release version bump to 1.18.5 2025-03-08 13:23:25 +00:00
Emmanuele Bassi
4541e0cd3a Release Cairo 1.18.4 2025-03-08 13:23:25 +00:00
Emmanuele Bassi
92dde935d4 ci: Allow failure on the Android job
The CI image we depend on is gone; until we can get something back, this
CI job should not block other work.
2025-03-08 13:23:25 +00:00
Emmanuele Bassi
bdd12408a7 Merge branch 'dwrite-coverage-map' into 'master'
DWrite: Get glyph coverage using IDWriteGlyphRunAnalysis

See merge request cairo/cairo!602
2025-02-21 17:32:28 +00:00
Luca Bacci
4d141f08fb DWrite: Add fallback for OS versions up to Windows 8
IDWriteGlyphRunAnalysis supports gray-scale antialiasing only when
created via IDWriteFactory2 (and newer), introduced in Windows 8.1

Fallback to using DIrect2D on A8 targets when IDWriteFactory2 is
not available.
2025-02-10 17:18:46 +01:00
Luca Bacci
78fca779ba DWrite: Get glyph coverage using IDWriteGlyphRunAnalysis 2025-02-10 17:18:40 +01:00
Uli Schlachter
b35a9ead97 Fix cairo-fdr and cairo-trace
This partially reverts commit ba4d5fbd5 from MR !343 which asked for
hidden symbols everywhere. cairo-fdr and cairo-trace explicitly try to
interpose existing symbols. Changing them to hidden symbols breaks these
tools.

See: https://gitlab.freedesktop.org/cairo/cairo/-/issues/882#note_2759005
Signed-off-by: Uli Schlachter <psychon@znc.in>
2025-01-31 18:10:47 +01:00
Emmanuele Bassi
3bfe1eed02 Merge branch 'meson' into 'master'
Minor Meson cleanups

See merge request cairo/cairo!584
2025-01-30 09:31:59 +00:00
Emmanuele Bassi
fe87f1c3fb Merge branch 'win32-cleanup' into 'master'
Win32 cleanup

See merge request cairo/cairo!605
2025-01-30 09:29:01 +00:00
Emmanuele Bassi
e2a52c0870 Merge branch 'dwrite-font-variations' into 'master'
DWrite: Add support for font variations

Closes #877

See merge request cairo/cairo!601
2025-01-30 09:26:49 +00:00
Emmanuele Bassi
ed7b0a54b9 Merge branch 'dwrite-fix-warnings' into 'master'
DWrite: Fix warnings

See merge request cairo/cairo!603
2025-01-30 09:25:57 +00:00
Luca Bacci
e0287e09f4 DWrite/GeometryRecorder: Add final specifier 2025-01-21 13:55:27 +01:00
Luca Bacci
46153a0408 DWrite/GeometryRecorder: Complete implementation of QueryInterface
...by checking for IUnknown.

This makes GeometryRecorder::QueryInterface compliant with the
rules of COM.

QueryInterface for IUnknown has a special meaning in COM: it's
used to check whether two interface pointers refer to the same
object.
2025-01-21 13:55:26 +01:00
Luca Bacci
59197e7791 DWrite/GeometryRecorder: Add noexcept specifier
STDMETHOD / IFACEMETHOD macros already add __declspec(nothrow), but
noexcept is better. From MSDN [1]:

  We recommend that all new code use the noexcept operator rather than
  __declspec(nothrow).
  This attribute tells the compiler that the declared function and the
  functions it calls never throw an exception. However, it does not
  enforce the directive. In other words, it never causes std::terminate
  to be invoked, unlike noexcept, or in std:c++17 mode (Visual Studio
  2017 version 15.5 and later), throw().

See also [2]:

  Non-throwing functions are permitted to call potentially-throwing
  functions. Whenever an exception is thrown and the search for a handler
  encounters the outermost block of a non-throwing function, the function
  std::terminate is called:

  extern void f(); // potentially-throwing

  void g() noexcept {
    f();      // valid, even if f throws
    throw 42; // valid, effectively a call to std::terminate
  }

References:

 [1] https://learn.microsoft.com/en-us/cpp/cpp/nothrow-cpp?view=msvc-170
 [2] https://en.cppreference.com/w/cpp/language/noexcept_spec
2025-01-21 13:55:19 +01:00
Luca Bacci
8107086c6a DWrite/GeometryRecorder: Add override specifier
IFACEMETHOD already adds the __override / __allowed(on_function) SAL
annotation (only on Windows SDK, not mingw-w64), which is understood
by some code analysis tools [1]. Since we're compiling in C++11 mode,
we can add the override specifier, so that the compiler is informed
as well.

[1] https://devblogs.microsoft.com/oldnewthing/20200911-00/?p=104205
2025-01-21 12:16:35 +01:00
Luca Bacci
bdac729974 DWrite/GeometryRecorder: Use IFACEMETHOD consistently
Fixes the following warnings on CLang:

  ../cairo/src/win32/cairo-dwrite-font.cpp:869:27: warning: exception specification
  of overriding function is more lax than base version [-Wmicrosoft-exception-spec]
    869 |     IFACEMETHODIMP_(void) SetFillMode(D2D1_FILL_MODE fillMode)
        |                           ^
  D:/msys64/clang64/include/d2d1.h:1491:22: note: overridden virtual function is here
   1491 |     STDMETHOD_(void, SetFillMode)(D2D1_FILL_MODE fillMode) PURE;
        |

COM objects are usually implemented like that:

1. The class is defined with only method declarations. For that,
   one should use IFACEMETHOD macros.
2. Then methods are implemented (defined), outside of the class
   definition. For that, one should use the IFACEMETHODIMP macros

If one really wants to provide inline method definitions (that is,
inside the class definition), then IFACEMETHOD macros should be used
(and not IFACEMETHODIMP, though it's a definition / implementation).
2025-01-21 12:02:51 +01:00
Luca Bacci
864ede8e1a Win32: Load system DLLs from System32 2025-01-21 11:59:09 +01:00
Luca Bacci
995c09ba67 Win32: Avoid library finalization on process termination
Library finalization should be done only for explicit library
unloads (dlclose / FreeLibrary), not for process termination.
2025-01-21 11:32:06 +01:00
Luca Bacci
1e5740c756 Revert "win32: Initialize mutexes for static builds for win32"
This reverts commit 5f90f0a706.

This is not needed anymore now that we have TLS callbacks.
2025-01-21 11:32:06 +01:00
Luca Bacci
3921eb96be Win32: Use TLS callback for module initialization and finalization
TLS callbacks are pretty much like DllMain but work also in
static builds.
2025-01-21 11:19:29 +01:00
Luca Bacci
3bc6b616a4 Win32: Rename _cairo_win32_print_gdi_error function
...to _cairo_win32_print_api_error, since it should not be used
with most GDI functions. Also move the function definition to
cairo-win32-system.c and change argument signature.
2025-01-21 11:10:02 +01:00