Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 00ef3983cae0373502e9816a7e7f4ab9ec5b8b83
https://github.com/WebKit/WebKit/commit/00ef3983cae0373502e9816a7e7f4ab9ec5b8b83
Author: Said Abou-Hallawa <[email protected]>
Date: 2026-09-10 (Thu, 10 Sep 2026)
Changed paths:
M Source/WebCore/Headers.cmake
M Source/WebCore/Sources.txt
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/platform/graphics/Font.cpp
M Source/WebCore/platform/graphics/Font.h
A Source/WebCore/platform/graphics/FontBase.cpp
A Source/WebCore/platform/graphics/FontBase.h
M Source/WebCore/platform/graphics/FontBaseline.h
M Source/WebCore/platform/graphics/FontCascade.h
M Source/WebCore/platform/graphics/FontInlines.h
M Source/WebCore/platform/graphics/FontMetrics.h
M Source/WebCore/platform/graphics/cairo/FontCairo.cpp
M Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp
M Source/WebCore/platform/graphics/coretext/FontCoreText.cpp
M Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
M Source/WebCore/platform/graphics/skia/FontCascadeSkia.cpp
M Source/WebCore/platform/graphics/skia/FontSkia.cpp
M Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp
Log Message:
-----------
[GPUProcess] Move the drawing Font functionalities to a new class named
FontBase
https://bugs.webkit.org/show_bug.cgi?id=323588
rdar://186827128
Reviewed by Cameron McCormack.
This work is a step toward using thread-safe Font objects in GPUProcess.
Similar to what we did for images in GPUProcess, we want to separate Font's
drawing
functionality from the rest of the class. For images, we split NativeImage out
from BitmapImageSource/ImageFrame: the former is used for displaying the image
and
is what gets transferred from the WebContent process to GPUProcess, while the
latter
handles image layout, providing information such as image size and orientation.
This change introduces a new class, FontBase, which can be passed to
FontCascade::drawGlyphs and is capable of drawing glyphs only. Font now inherits
from FontBase, and in addition to drawing, it still owns the glyph tables and
handles glyph measurement and layout. Font remains RefCounted, as before.
A follow-up PR will add a thread-safe class that also inherits from FontBase
and,
like it, can only draw glyphs. This restriction makes sense because GPUProcess
shouldn't be responsible for mapping characters to glyphs or decomposing colored
glyphs into their components — it should only call drawGlyphsImmediate().
RemoteRenderingBackend will create instances of this new class instead of Font,
so they can be shared across threads. This also means 317722@main will be
reverted:
DrawGlyphs will hold a Ref<FontBase>, and DrawGlyphs::draw() will call
drawGlyphsImmediate() instead of calling drawGlyphs().
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/Font.cpp:
(WebCore::Font::Font):
(WebCore::m_shouldNotBeUsedForArabic): Deleted.
(WebCore::Font::renderingResourceIdentifier const): Deleted.
(WebCore::FontInternalAttributes::ensureRenderingResourceIdentifier const):
Deleted.
(WebCore::Font::mathData const): Deleted.
(WebCore::Font::platformCharHeightInit):
(WebCore::Font::applyFontMetricsOverrides): Deleted.
* Source/WebCore/platform/graphics/Font.h:
(WebCore::Font::createSystemFallbackFontPlaceholder):
(WebCore::Font::isSystemFontFallbackPlaceholder const): Deleted.
(WebCore::Font::hasVerticalGlyphs const): Deleted.
(WebCore::Font::origin const): Deleted.
(WebCore::Font::isInterstitial const): Deleted.
(WebCore::Font::visibility const): Deleted.
(WebCore::Font::allowsAntialiasing const): Deleted.
(WebCore::Font::shouldNotBeUsedForArabic const): Deleted.
(WebCore::Font::setIsUsedInSystemFallbackFontCache): Deleted.
(WebCore::Font::isUsedInSystemFallbackFontCache const): Deleted.
(WebCore::Font::isTextOrientationFallback const): Deleted.
(WebCore::Font::sizePerUnit const): Deleted.
(WebCore::Font::syntheticBoldOffset const): Deleted.
(WebCore::Font::ctFont const): Deleted.
(WebCore::Font::ComplexColorFormatGlyphs::hasRelevantTables const): Deleted.
(WebCore::Font::ComplexColorFormatGlyphs::bitForInitialized): Deleted.
(WebCore::Font::ComplexColorFormatGlyphs::bitForValue): Deleted.
(WebCore::Font::ComplexColorFormatGlyphs::bitsRequiredForGlyphCount): Deleted.
(WebCore::Font::ComplexColorFormatGlyphs::ComplexColorFormatGlyphs): Deleted.
(WebCore::Font::maxCharWidth const): Deleted.
(WebCore::Font::setMaxCharWidth): Deleted.
(WebCore::Font::avgCharWidth const): Deleted.
(WebCore::Font::setAvgCharWidth): Deleted.
(WebCore::Font::spaceWidth const): Deleted.
* Source/WebCore/platform/graphics/FontBase.cpp: Added.
(WebCore::FontBase::FontBase):
(WebCore::FontBase::mathData const):
(WebCore::FontInternalAttributes::ensureRenderingResourceIdentifier const):
(WebCore::FontBase::renderingResourceIdentifier const):
(WebCore::FontBase::applyFontMetricsOverrides):
* Source/WebCore/platform/graphics/FontBase.h: Added.
(WebCore::FontBase::origin const):
(WebCore::FontBase::isInterstitial const):
(WebCore::FontBase::visibility const):
(WebCore::FontBase::isTextOrientationFallback const):
(WebCore::FontBase::isSystemFontFallbackPlaceholder const):
(WebCore::FontBase::allowsAntialiasing const):
(WebCore::FontBase::hasVerticalGlyphs const):
(WebCore::FontBase::isUsedInSystemFallbackFontCache const):
(WebCore::FontBase::setIsUsedInSystemFallbackFontCache):
(WebCore::FontBase::shouldNotBeUsedForArabic const):
(WebCore::FontBase::verticalData const):
(WebCore::FontBase::sizePerUnit const):
(WebCore::FontBase::syntheticBoldOffset const):
(WebCore::FontBase::ctFont const):
(WebCore::FontBase::ComplexColorFormatGlyphs::hasRelevantTables const):
(WebCore::FontBase::ComplexColorFormatGlyphs::bitForInitialized):
(WebCore::FontBase::ComplexColorFormatGlyphs::bitForValue):
(WebCore::FontBase::ComplexColorFormatGlyphs::bitsRequiredForGlyphCount):
(WebCore::FontBase::ComplexColorFormatGlyphs::ComplexColorFormatGlyphs):
(WebCore::FontBase::spaceWidth const):
(WebCore::FontBase::maxCharWidth const):
(WebCore::FontBase::setMaxCharWidth):
(WebCore::FontBase::avgCharWidth const):
(WebCore::FontBase::setAvgCharWidth):
* Source/WebCore/Headers.cmake:
* Source/WebCore/platform/graphics/FontInlines.h:
(WebCore::Font::verticalData const): Deleted.
* Source/WebCore/platform/graphics/coretext/FontCoreText.cpp:
(WebCore::FontBase::supportsOpenTypeAlternateHalfWidths const):
(WebCore::FontBase::supportsSmallCaps const):
(WebCore::FontBase::supportsAllSmallCaps const):
(WebCore::FontBase::supportsPetiteCaps const):
(WebCore::FontBase::supportsAllPetiteCaps const):
(WebCore::FontBase::otSVGTable const):
(WebCore::FontBase::hasComplexColorFormatTables const):
(WebCore::FontBase::glyphsWithComplexColorFormat const):
(WebCore::FontBase::glyphHasComplexColorFormat const):
(WebCore::FontBase::metricsForMultiRepresentationHEIC const):
(WebCore::Font::supportsOpenTypeAlternateHalfWidths const): Deleted.
(WebCore::Font::supportsSmallCaps const): Deleted.
(WebCore::Font::supportsAllSmallCaps const): Deleted.
(WebCore::Font::supportsPetiteCaps const): Deleted.
(WebCore::Font::supportsAllPetiteCaps const): Deleted.
(WebCore::Font::otSVGTable const): Deleted.
(WebCore::Font::hasComplexColorFormatTables const): Deleted.
(WebCore::Font::glyphsWithComplexColorFormat const): Deleted.
(WebCore::Font::glyphHasComplexColorFormat const): Deleted.
(WebCore::Font::metricsForMultiRepresentationHEIC const): Deleted.
(WebCore::fontHasEitherTable):
(WebCore::supportsOpenTypeFeature):
(WebCore::FontBase::platformInit):
(WebCore::Font::platformCharHeightInit):
(WebCore::FontBase::findOTSVGGlyphs const):
(WebCore::FontBase::hasAnyComplexColorFormatGlyphs const):
(WebCore::Font::platformInit): Deleted.
(WebCore::Font::findOTSVGGlyphs const): Deleted.
(WebCore::Font::hasAnyComplexColorFormatGlyphs const): Deleted.
* Source/WebCore/platform/graphics/skia/FontSkia.cpp:
(WebCore::FontBase::buildTextBlob const):
(WebCore::FontBase::enableAntialiasing const):
(WebCore::Font::buildTextBlob const): Deleted.
(WebCore::Font::enableAntialiasing const): Deleted.
(WebCore::FontBase::platformInit):
(WebCore::Font::platformInit): Deleted.
* Source/WebCore/platform/graphics/FontBaseline.h:
* Source/WebCore/platform/graphics/FontMetrics.h:
* Source/WebCore/platform/graphics/FontCascade.h:
* Source/WebCore/platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp:
(WebCore::computeOverallTextMatrix):
(WebCore::computeVerticalTextMatrix):
(WebCore::showGlyphsWithAdvances):
(WebCore::FontCascade::drawGlyphs):
* Source/WebCore/platform/graphics/skia/FontCascadeSkia.cpp:
(WebCore::FontCascade::drawGlyphs):
* Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::FontBase::platformInit):
(WebCore::Font::platformInit): Deleted.
* Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp:
(WebCore::FontBase::platformInit):
(WebCore::Font::platformInit): Deleted.
Canonical link: https://commits.webkit.org/320875@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications