does not produce Xft fonts on 1-bit pixmaps
Submitted by Dmitry Karasik
Assigned to Xorg Project Team
Link to original bug (#106419)
Description
Created attachment 139390 test program
OS Version: Ubuntu 16.04-xenial #146-Ubuntu 4.4.0-122-generic Xorg Version: 1.18.3
Fontconfig fonts rendering via Xft/Xrender on the client and through render/glamor on the server do not produce result when the destination drawable is a 1-bit pixmap.
Please find the demonstration C program attached, that on my laptop produces these results:
| depth=1
| *
|
|
|
| depth=24
| ** *
| ******
| ****
| ***
Where a 8x4 bitmap is produced in two versions, 1-bit and 24-bit, both are cleared with color 0, then a single white pixel and a letter "r" is written on it. The 24-bit produces (low-res, antialiased, but just for the sake of experiment) both glyph and pixel, and 1-bit produces pixel only.
I managed to produce good results after applying this fix:
--- /home/dk/src/xorg-server-1.18.3/glamor/glamor_utils.h 2016-04-04 20:33:37.000000000 +0200 +++ ./glamor_utils.h 2018-05-06 14:33:43.281740484 +0200 @@ -707,7 +707,8 @@
/* For 1bpp pixmap, we don't store it as texture. */ #define glamor_check_pixmap_fbo_depth(depth) ( \
-
_depth_ == 8 \
-
_depth_ == 1 \
-
|| _depth_ == 8 \ || _depth_ == 15 \ || _depth_ == 16 \ || _depth_ == 24 \
where the output of the program is this:
| depth=1
| *
| ***
| *
| *
| depth=24
| ** *
| ******
| ****
| ***
However the comment shows that 1-bit pixmaps are treated specially with regards to the FBO allocation, and I'm fairly sure that if this change is not the best fix, then the correct 1-bit rendering should be done elsewhere.
After digging in the source it seems that change came somewhere before 355334fc in 2012, which means that there might be more unknowns in the setup that I have on my Ubuntu, if this bug was not discovered in 6 years.
Unfortunately I couldn't build the latest xserver from github because it requires many new libraries that I cannot install on the laptop without breaking the existing installation. However if you need me to test patches, you may backport them to 1.18.3 , as I can only experiment on this version. If successfull, patches can also be sent to ubuntu/debian package maintainers.
Sincerely, Dmitry Karasik
Attachment 139390, "test program":
test.c