[GPUProcess] Move the drawing Font functionalities to a new class named FontBase
Component: WebCore Graphics / GPU Process | 00ef398
Source/WebCore/platform/graphics/Font.h
Source/WebCore/platform/graphics/Font.cpp
WebKit renders in two processes: WebContent builds display lists referencing resources — images, fonts — by a RenderingResourceIdentifier, and the GPU process replays those lists off-thread to paint. Previously Font bundled everything in one RefCounted object: full glyph shaping and mapping (WebContent-only) alongside the actual drawing calls (needed by the GPU process).
This commit splits Font into a new base class, FontBase, owning glyph-drawing functionality — platform draw calls, rendering resource identifier, math data, metric overrides — while Font inherits from it and retains glyph-table ownership, glyph mapping, and text-layout logic.
Before: After:
Font (RefCounted) FontBase (virtual ref/deref)
├─ drawing (drawGlyphsImmediate) ├─ drawing (drawGlyphsImmediate)
├─ renderingResourceIdentifier ├─ renderingResourceIdentifier
├─ mathData / metric overrides ├─ mathData / metric overrides
├─ glyph mapping / shaping │ ▲ inherits
└─ used by WebContent + GPUProcess Font : FontBase, RefCounted<Font>
(via DrawGlyphs) └─ glyph mapping / shaping (WebContent only)
(future) ThreadSafeFontBase : FontBase
└─ shareable with GPUProcess, draw-only
Significance
This mirrors the earlier NativeImage/BitmapImageSource split and is explicit groundwork for a thread-safe FontBase subclass that RemoteRenderingBackend can construct and share across threads. The isolation is the point: a forthcoming thread-safe class can inherit the drawing-only surface without dragging along shaping state that must never cross threads, and the GPU process is meant to only call drawGlyphsImmediate(), never map characters to glyphs itself. That will change how DrawGlyphs display-list commands reference font resources.
Audit directions
This is a large mechanical move of ~40 methods and several boolean flags — m_treatAsFixedPitch, m_isBrokenIdeographFallback, m_hasVerticalGlyphs, m_isUsedInSystemFallbackFontCache, m_shouldNotBeUsedForArabic — out of Font's explicit constructor initializer list and into FontBase. Narrow: confirm every flag still gets a correct default via member initializer in FontBase.h rather than being silently left uninitialized; the match tell is a flag that appeared in the deleted initializer list but has no corresponding { false }/{ true } in the new header. An uninitialized shouldNotBeUsedForArabic or system-fallback-placeholder flag would affect glyph-fallback and bidi text rendering, an area with a history of spoofing-adjacent bugs. Wider: track how FontInternalAttributes::ensureRenderingResourceIdentifier's lazy-identifier logic behaves once a thread-safe FontBase subclass lands, since identifier collisions or races there directly affect cross-process resource matching in RemoteRenderingBackend — the general shape to watch is lazy identifier assignment on a type that is about to become concurrently constructible. Widest: any mechanical hoist of initializer-list members into a base class is a silent-default hazard, and the portable check is to diff the removed initializer list against the new header's member initializers field by field rather than trusting the build to catch it.