[webkit-changes] [WebKit/WebKit] c3af7a: Refactor Font::systemFallback to use a proper Font...

Vitor Roriz noreply at github.com
Thu Oct 17 17:45:28 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c3af7ac0c64b03be767aa648f3ad9e323236821a
      https://github.com/WebKit/WebKit/commit/c3af7ac0c64b03be767aa648f3ad9e323236821a
  Author: Vitor Roriz <vitor.roriz at apple.com>
  Date:   2024-10-17 (Thu, 17 Oct 2024)

  Changed paths:
    M Source/WebCore/platform/graphics/ComplexTextController.cpp
    M Source/WebCore/platform/graphics/Font.cpp
    M Source/WebCore/platform/graphics/Font.h
    M Source/WebCore/platform/graphics/FontCascade.cpp
    M Source/WebCore/platform/graphics/FontCascade.h
    M Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp
    M Source/WebCore/platform/graphics/coretext/ComplexTextControllerCoreText.mm
    M Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp
    M Source/WebCore/platform/graphics/skia/FontCascadeSkia.cpp

  Log Message:
  -----------
  Refactor Font::systemFallback to use a proper Font object placeholder
https://bugs.webkit.org/show_bug.cgi?id=281681
rdar://problem/138132620

Reviewed by Ryosuke Niwa.

Font::systemFallback uses a -1 (0xfff...f) address to represent a Font pointer
that is a system font fallback. This is obviously not a valid address and is used
as a placeholder. Such a pointer will be later handled and allocated properly.

This approach is error-prone and disables us from adopting RefPtr<Font> at some locations,
since we can't create a RefPtr of an invalid address.

This patch replaces such strategy by creating a Font representation of such placeholder,
which is now a valid Font object and can be used with a RefPtr.

* Source/WebCore/platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::collectComplexTextRuns):
* Source/WebCore/platform/graphics/Font.cpp:
(WebCore::Font::Font):
* Source/WebCore/platform/graphics/Font.h:
(WebCore::Font::createSystemFallbackFontPlaceholder):
(WebCore::Font::isSystemFontFallbackPlaceholder const):
(WebCore::Font::systemFallback): Deleted.
* Source/WebCore/platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const):
(WebCore::shouldSynthesizeSmallCaps):
* Source/WebCore/platform/graphics/FontCascade.h:
* Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const):
* Source/WebCore/platform/graphics/coretext/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const):
* Source/WebCore/platform/graphics/skia/FontCascadeSkia.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const):

Canonical link: https://commits.webkit.org/285370@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list