Bug 130233 - Skia: quality of font rendering to canvas is degraded
Summary: Skia: quality of font rendering to canvas is degraded
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
7.0.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Luboš Luňák
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Font-Rendering Skia
  Show dependency treegraph
 
Reported: 2020-01-27 20:18 UTC by V Stuart Foote
Modified: 2020-03-20 01:45 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Draw file with screenshoot skia<->OpenGL (284.61 KB, application/vnd.oasis.opendocument.graphics)
2020-01-28 01:38 UTC, m.a.riosv
Details
zip of several screen clips Writer document and UI with Skia-Vulkan and OpenGL (286.66 KB, application/x-zip-compressed)
2020-01-28 15:59 UTC, V Stuart Foote
Details
comparison rendering of Help -> About current 7.0.0 alpha0+ master (1.82 MB, image/png)
2020-02-10 19:59 UTC, V Stuart Foote
Details
Comparison of Help rendering Skia/Vulkan with/without antialaising (145.98 KB, image/png)
2020-02-11 00:53 UTC, m.a.riosv
Details
screenshot of menu text and document text (5.70 KB, image/png)
2020-03-04 22:09 UTC, Regina Henschel
Details
comparisons of default GID, OpenGL, Skia/Vulkan, Skia/raster rendering of text (73.86 KB, image/png)
2020-03-07 17:49 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description V Stuart Foote 2020-01-27 20:18:27 UTC
Not clear how the plumbing changes but the skia font rendering to canvas seems very "scratchy" on Windows builds. Certainly worse than default GDI, or with OpenGL rendering.
Comment 1 V Stuart Foote 2020-01-27 21:08:14 UTC
On current build of master on Windows 10 with both nVidia or Intel GPUs (recent drivers so good Vulkan support). In the GUI, note on any of the main menu, or dialog list boxes, the leading round edges of "G", "O", "C" glyphs are not at all smooth. Likewise for the "O" or the "C" on the StartCenter for the Open Filer or Calc Spreadsheet button labels.

Enabling disabling the 'Use anti-alaising' has no effect.

We know it will work, evidenced by Chrome's browsers clear text rendering. 

Assume we still have dependencies of bug 103322, but was a lot of grief first with OpenGL then when we brought in HarfBuzz at 5.3; to avoid similar complaints and disruption moving forward with Skia can we address rendering mode--ClearType mode, and antialaising--sooner rather than later?
Comment 2 m.a.riosv 2020-01-28 01:38:06 UTC
Created attachment 157472 [details]
Draw file with screenshoot skia<->OpenGL

Hi Stuart, for me looks a bit better with skia (my eyesight is not the best for the test:).
LibreOffice version in the attachment.
opengl_device.log
DriverVersion: 26.20.100.7755
DriverDate: 1-9-2020
DeviceID: PCI\VEN_8086&DEV_5916&SUBSYS_380117AA&REV_02
AdapterVendorID: 0x8086
AdapterDeviceID: 0x5916
AdapterSubsysID: 0x380117aa
DeviceKey: System\CurrentControlSet\Control\Video\{EB4EA3C3-3E3A-11EA-B14C-F6D97F3FA781}\0000
DeviceString: Intel(R) HD Graphics 620
Comment 3 V Stuart Foote 2020-01-28 15:59:08 UTC
Created attachment 157484 [details]
zip of several screen clips Writer document and UI with Skia-Vulkan and OpenGL

Screen clips from 1920x1080 res monitor, Intel HD Graphics 620 (26.20.100.7584) Windows 10 1903, Google Roboto regular (unhinted) installed to system.

Pairs of LO with OpenGL v. Skia/Vulkan rendering of the UI.

One set shows smooth Chrome browser rendering of Roboto regular sample text with LO writer canvas rendering of the same text.

Other set shows LO rendering of document at 250% with the 'Insert' menu showing.

So, while for the Roboto font, rendering to document canvas is not excessively different--both renderings are rough--the Skia/Vulkan rendering has line weight and aliasing issues.

Where differences are quite noticeable is in rendering the LibreOffice user interface (which IIUC is fully hinted Segoe UI). The labeling of LO menu entries with Skia/Vulkan at screen resolution is painful.
Comment 4 V Stuart Foote 2020-02-10 19:59:50 UTC
Created attachment 157780 [details]
comparison rendering of Help -> About current 7.0.0 alpha0+ master

The attached image shows clips of the Help -> About dialog from a Windows 10 Ent 64-bit with nVidia K2000 GPU (26.21.14.4128)

panels, left to right, are showing rendering by

Default GDI
OpenGL
Skia/Vulkan
Skia/raster

I know quality is subjective, but the Default GDI rendering seems crispest. The OpenGL DWRITE grayscale antialaising is acceptable.  But for both Vulkan renderings, the antialaising seems too heavy--almost smeared--note the O o 0 and ( ), as well as the W and V glyphs.
Comment 5 m.a.riosv 2020-02-11 00:53:14 UTC
Created attachment 157783 [details]
Comparison of Help rendering Skia/Vulkan with/without antialaising

Difficult to say which looks better. The black looks more black in the order of the selection.

Attached a comparison Skia/Vulkan with/without antialaising, and on my view if one looks better is without.
Comment 6 V Stuart Foote 2020-02-11 14:41:36 UTC
(In reply to m.a.riosv from comment #5)
> Attached a comparison Skia/Vulkan with/without antialaising, and on my view
> if one looks better is without.

Hmm, but yes your clip of Skia/Vulkan with VCL "antialaising" enabled renders worse than the clip wihtout antialaising. 

But both are painful compared to legacy GDI or OpenGL...
Comment 7 m.a.riosv 2020-02-12 08:41:19 UTC
But perhaps depends also on the quality of the screen, and the use case. Being darkness the text can help e.g. editing text or formulas.

Why the hell does an office software need to deal with such a variety of graphic supports? and the hardware largely underutilized, at ridiculous levels.
Comment 8 Regina Henschel 2020-03-04 22:09:12 UTC
Created attachment 158398 [details]
screenshot of menu text and document text

I see bad font rendering too, both in menus and in the text.
I have got a "Intel HD Graphics 630" on Windows 10.
Comment 9 V Stuart Foote 2020-03-07 17:49:56 UTC
Created attachment 158476 [details]
comparisons of default GID, OpenGL, Skia/Vulkan, Skia/raster rendering of text

Attaching rendering samples of the Help -> About dialog for latest 2020-03-07 tb77 Windows build of master. Still noticeably degraded rendering of the Skia Vulcan or Skia raster modes compared to default GDI or OpenGL rendering.

On Windows 10 Home 64-bit en-US (1909) with Intel HD Graphics 620 (drvr 26.20.100.7755) and Version: 7.0.0.0.alpha0+ (x64)
Build ID: 10e20a77ce302a0475a661ad1886f2ca83c55f3f
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Vulkan; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded
Comment 10 V Stuart Foote 2020-03-07 18:29:08 UTC
With Skia/Vulkan now set as the default rendering mode for Windows builds this will become a source of UX complaints.

Is this a Direct2D or GDI/GDI+ issue?

Is Chrome doing well with Skia because they have implemented Freetype? Is that going to be needed along with floating point composition (bug 103322) to get clean font rendering to canvas and the GUI?
Comment 11 Tomaz Vajngerl 2020-03-07 19:54:46 UTC
AFAIK Skia still uses the same font rendering than with OpenGL - using DirectWrite to a texture atlas, then using Skia to render the texture. 

There is work on rendering fonts using Skia directly, so I would wait until that lands and then retest.
Comment 12 Tomaz Vajngerl 2020-03-07 19:56:16 UTC
"AFAIK Skia still uses the same font rendering..."

I meant "Skia" here as LibreOffice Skia backend.
Comment 13 Luboš Luňák 2020-03-18 13:57:13 UTC
Current master (1ad3f6b8d9e0ef1e921c3ed5526ea352d67265cf) now uses Skia also for text rendering, and AFAICT the result is the same as with the GDI VCL backend.
Comment 14 V Stuart Foote 2020-03-20 01:45:08 UTC
Verified! Skia/Vulkan and Skia/Raster both now look as good as Default GDI or OpenGL rendering.

Version: 7.0.0.0.alpha0+ (x64)
Build ID: 6388c578c672690fff662cb04b6a0436cd742f37
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: Skia/Vulkan; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: CL