[GUI] Replace GDI/FreeType per-glyph SKPath extraction and multi-pass LCD FBO text emulation with native Skia GPU glyph atlas

Open
#225 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp

Research direction

Start with sources/Cairo/wrapper/RecordedGuiDrawing.cs and RecordedGpuBlur.cs, then trace the production GPU text rendering path and its Skia Ganesh canvas usage. Check the font and recorder parity tests in Optimum.Tests, including the 65 Linux failures cited in the issue. Done means GPU text uses native SKFont or SKTextBlob drawing and the custom GDI/FreeType extraction and dual-surface LCD compositing paths are removed.

Written by the indexing model from the issue text.

Description

complexity: hard performance rendering

Problem

To emulate Cairo/Pixman subpixel text output pixel-for-pixel, the current GUI text pipeline bypasses Skia Ganesh's native GPU glyph atlas:

  1. WindowsGdiTextCoverage and SkiaHintedFontOutlines invoke gdi32.dll on Windows and libfreetype on Linux to extract hinted glyph outlines and convert individual glyphs into SKPath objects (sources/Cairo/wrapper/RecordedGuiDrawing.cs:280-530).
  2. RecordedGpuBlur.DrawLcdText (sources/Cairo/wrapper/RecordedGpuBlur.cs:180-310) renders text twice into separate lcdBlack and lcdWhite offscreen GPU surfaces and composites them with a custom SKRuntimeEffect shader.

Converting text into per-glyph SKPath geometry or dual-FBO offscreen passes defeats Skia's internal GPU glyph cache/atlas, adds thousands of lines of platform P/Invoke code, and leaves 65 font/recorder parity tests failing in Optimum.Tests on Linux.

Proposed Fix

  • Render GUI text on the GPU path using native SKFont / SKTextBlob drawing directly onto the target SKCanvas so Skia Ganesh caches glyphs in its GPU atlas and batches text in a single pass.
  • Remove the custom GDI/FreeType outline extraction and dual-surface LCD compositing paths from the production GPU renderer.
Dominant language
C#
Stars
22
Forks
4
Avg merge
1h 11m
Merged PRs (30d)
40

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from StratumServer/Optimum

All issues in StratumServer/Optimum

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.