View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0010185 | ardour | documentation | public | 2026-02-14 13:49 | 2026-02-17 00:15 |
| Reporter | u1f992 | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | new | Resolution | open | ||
| Platform | Ubuntu | OS | Linux | OS Version | (any) |
| Product Version | 9.0 | ||||
| Summary | 0010185: Cairo patch not linked from documentation | ||||
| Description | Current Build-time Ardour Dependencies (https://ardour.org/current_dependencies.html) lists cairo under "Libraries Requiring Modified Versions", but I could not find the actual patch. The nightly build dependencies page (https://nightly.ardour.org/list.php#build_deps) links to the unmodified upstream cairo (`http://cairographics.org/releases/cairo-1.16.0.tar.xz`), and neither page links to a patch or patched tarball for cairo. The freetype section of `current_dependencies.html` links directly to its patch at `https://raw.github.com/Ardour/ardour/2.0-ongoing/tools/misc-patches/freetype-bytecode.patch`. I found a file `tools/misc-patches/cairo-gradients.patch` on the same branch (commit `990fd441d9`) and it seems to produce a matching `libcairo.so.2`, but since it is not referenced from any documentation I am not sure this is the right one. Could a link to the cairo patch be added to `current_dependencies.html` (similar to the freetype patch), or could a patched tarball be hosted on the nightly page? | ||||
| Steps To Reproduce | 1. Visit https://ardour.org/current_dependencies.html. Cairo is listed under "Libraries Requiring Modified Versions" but has no link to a patch (compare with the Freetype section which links directly to its patch). 2. Visit https://nightly.ardour.org/list.php#build_deps. The cairo entry links to unmodified upstream source. 3. Extract `libcairo.so.2` from the Ardour 9.0 Linux x86_64 installer and compare with one built from the upstream source. The installer version contains `FORCE_BUGGY_GRADIENTS` in `.rodata` and a `getenv("ARDOUR_FORCE_BUGGY_GRADIENTS")` call in `.text` that are absent from the upstream build. | ||||
| Additional Information | The patch appears to add a `FORCE_BUGGY_GRADIENTS` environment variable check to `src/cairo-xlib-display.c` and define `CAIRO_SUPPORTS_FORCE_BUGGY_GRADIENTS_ENVIRONMENT_VARIABLE` in `src/cairo.h`. These are referenced by Ardour's `gtk2_ardour/ui_config.cc` and `gtk2_ardour/rc_option_editor.cc` via `#ifdef` guards. Cairo is licensed under LGPL 2.1. | ||||
| Tags | No tags attached. | ||||
|
|
I did some additional investigation and found that the patch on the 2.0-ongoing branch (tools/misc-patches/cairo-gradients.patch, commit 990fd441d9) is outdated and insufficient for the current cairo (1.16.0), unlike the freetype patch which still applies cleanly. Two issues: 1. The original patch targets cairo 1.10.2 code that has been significantly rewritten in 1.16.0. That said, the specific `#if RENDER_MAJOR` / `display->buggy_gradients = FALSE;` block still exists at line 266, so this hunk does apply. The surrounding vendor-detection code (lines 318-343) is new in 1.16.0 but does not conflict. 2. The repository patch only modifies cairo-xlib-display.c. It does not add `#define CAIRO_SUPPORTS_FORCE_BUGGY_GRADIENTS_ENVIRONMENT_VARIABLE` to cairo.h. Without this define, Ardour's #ifdef guards in gtk2_ardour/ui_config.cc:232 and gtk2_ardour/rc_option_editor.cc:3186 compile out the entire feature. The "Possibly improve slow graphical performance" preference option never appears, and the FORCE_BUGGY_GRADIENTS environment variable is never set. The attached patch addresses both points and produces a libcairo.so.2 binary-identical to the one shipped in the official Ardour 9.0 Linux installer. cairo-force-buggy-gradients.patch (1,155 bytes)
Ardour-specific patch for cairo 1.16.0: FORCE_BUGGY_GRADIENTS environment variable.
Allows users to force software gradient rendering on Linux systems with buggy
GPU drivers (notably older NVIDIA) by setting FORCE_BUGGY_GRADIENTS=1.
Origin: Ardour git commit 990fd441d9 (2.0-ongoing branch, 2012-05-22)
plus header macro addition for Ardour's #ifdef guard.
Reference: https://ardour.org/current_dependencies.html
"patched to allow users to disable h/w gradient rendering
on buggy Linux video drivers"
--- a/src/cairo-xlib-display.c
+++ b/src/cairo-xlib-display.c
@@ -266,7 +266,12 @@
#if RENDER_MAJOR == 0 && RENDER_MINOR < 10
display->buggy_gradients = TRUE;
#else
- display->buggy_gradients = FALSE;
+ if (getenv ("FORCE_BUGGY_GRADIENTS")) {
+ display->buggy_gradients = TRUE;
+ }
+ else {
+ display->buggy_gradients = FALSE;
+ }
#endif
display->buggy_pad_reflect = FALSE;
display->buggy_repeat = FALSE;
--- a/src/cairo.h
+++ b/src/cairo.h
@@ -3179,4 +3179,6 @@
CAIRO_END_DECLS
+#define CAIRO_SUPPORTS_FORCE_BUGGY_GRADIENTS_ENVIRONMENT_VARIABLE
+
#endif /* CAIRO_H */
|
|
|
There are numerous other patches that are applied as part of our dependency stack building. They are currently in a repository that does not have public access. We will consider how best to make them available. |
|
|
Thank you for considering making the patches publicly available. That would be very helpful. |