Skip to content

[asimage/asutils] fix linkage problem, fully separate X11-specific methods - #23902

Open
linev wants to merge 9 commits into
root-project:masterfrom
linev:asimage_utils_linker
Open

linev wants to merge 9 commits into
root-project:masterfrom
linev:asimage_utils_linker

Conversation

@linev

@linev linev commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

For X11-specific methods there is special ASVisual instance which needs X11
display, screen and several other parameters. Use this instance only for X11-specific
operations. This instance returned by static TASImage::InitVisual() method.
All old methods where such instance is used now marked as @deprecated

For most of basic image transformations like Mirror or Crop or Merge such x11-specific visual
is not necessary. Therefore BatchASVisualHolder class is introduced which
holdes thread_local "batch" instance of ASVisual. It used now in most of TASImage methods
and automatically cleanup when thread closed or process ends. This holder object
also manages font handler when required

IMPORTANT!

Move all direct calls to libAfterImage functions to TASImage library.
Original design of TASUtils class had dirct link with static libAfterImage library.
But TASImage itself linked also with libAfterImage - making troubles on Windows.
Therefore number of private static methods were introduced in TASImage class
which just redirect to existing libAferImage functions.
TASUtils uses only TASImage methods and not linked with libAfterImage

Probably need to be applied to 6.42 branch

@linev linev self-assigned this Oct 30, 2026
@linev
linev marked this pull request as draft October 30, 2026 06:59
@linev linev added this to the 6.42.00 milestone Oct 30, 2026
@linev
linev force-pushed the asimage_utils_linker branch from 39c03ff to cbccdb9 Compare October 30, 2026 07:20
linev added 9 commits October 30, 2026 12:58
It is thread_local and correctly cleanup when thread or process is closed.
It only should be used for batch (without disaplay) operation

First use for paint and assign image
When painting text, asimage create font manager. It need to be correctly destroyed at the end
Static method InitVisual() holds own static pointer, which returned from the method.
All methods where InitVisual() is used are deprecated, correspondent docu refer also on
alternative methods from TASUtils which can be used.
It will return not-null value only for X11-based disaplays in not-batch mode.
In all other cases alternative methods should be used.

Intention to move all asimage calls only inside TASImage class to avoid different linking side-effects observed on Windows
Provide several static private methods for such redirection.

Link libAfterImage only with TASImage class,
trying to avoid any future conflicts with Windows linker
Simultaneous link of same static library with two shared libraries can be a problem
@linev
linev force-pushed the asimage_utils_linker branch from cbccdb9 to 79f7467 Compare October 30, 2026 11:59
@linev
linev marked this pull request as ready for review October 30, 2026 12:58
@github-actions

Copy link
Copy Markdown

Test Results

    24 files      24 suites   4d 1h 2m 22s ⏱️
 3 883 tests  3 883 ✅ 0 💤 0 ❌
83 646 runs  83 646 ✅ 0 💤 0 ❌

Results for commit 79f7467.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant