Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9ab41908f1d8e47dc4ec29e7af03be97c6e8d110
      
https://github.com/WebKit/WebKit/commit/9ab41908f1d8e47dc4ec29e7af03be97c6e8d110
  Author: Vitor Roriz <vitor.ro...@apple.com>
  Date:   2025-03-06 (Thu, 06 Mar 2025)

  Changed paths:
    M Source/WebCore/platform/graphics/FontCache.cpp
    M Source/WebCore/platform/graphics/FontCache.h
    M Source/WebCore/platform/graphics/FontCascade.cpp
    M Source/WebCore/platform/graphics/FontCascade.h
    M Source/WebCore/platform/graphics/FontCascadeCache.cpp
    M Source/WebCore/platform/graphics/FontCascadeCache.h
    M Source/WebCore/platform/graphics/FontCascadeFonts.cpp
    M Source/WebCore/platform/graphics/FontCascadeFonts.h
    M Source/WebCore/rendering/style/RenderStyle.cpp
    M Source/WebCore/rendering/style/RenderStyle.h

  Log Message:
  -----------
  Refactoring: Making FontCascadeFonts "free" of FontSelector
https://bugs.webkit.org/show_bug.cgi?id=289265
rdar://146405854

Reviewed by Matthieu Dubet.

FontCascadeFonts is currently store in FontCascadeCache.
FontCascadeFonts currently holds a RefPtr to its related FontSelector.

In order to make it possible to share FontCascadeFont across documents (for 
specific simple cases),
we need to make FontCascadeFont free of context.

This patch proposes that FontCascade should hold the FontSelector instead.
FontCascade is already responsible for interfacing between 
FontCascadeDescription
and FontCascadeFonts. Also, FontCascadeFonts is usually accessed through
FontCascade via functions like ::glyphDataForCharacter, ::width and others, so 
it
make it simpler for passing the FontSelector to FontCascadeFonts when needed.

This patch is just a refactoring preparation and should produce no changes.

* Source/WebCore/platform/graphics/FontCache.cpp:
(WebCore::FontCache::updateFontCascade):
* Source/WebCore/platform/graphics/FontCache.h:
* Source/WebCore/platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::FontCascade):
(WebCore::FontCascade::operator=):
(WebCore::FontCascade::operator== const):
(WebCore::FontCascade::isCurrent const):
(WebCore::FontCascade::fontSelectorVersion const):
(WebCore::FontCascade::update const):
(WebCore::FontCascade::glyphDataForCharacter const):
(WebCore::operator<<):
* Source/WebCore/platform/graphics/FontCascade.h:
(WebCore::FontCascade::primaryFont const):
(WebCore::FontCascade::fallbackRangesAt const):
(WebCore::FontCascade::isFixedPitch const):
(WebCore::FontCascade::canTakeFixedPitchFastContentMeasuring const):
(WebCore::FontCascade::fontSelector const):
* Source/WebCore/platform/graphics/FontCascadeCache.cpp:
(WebCore::FontCascadeCache::retrieveOrAddCachedFonts):
* Source/WebCore/platform/graphics/FontCascadeCache.h:
* Source/WebCore/platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::FontCascadeFonts):
(WebCore::FontCascadeFonts::determinePitch):
(WebCore::FontCascadeFonts::determineCanTakeFixedPitchFastContentMeasuring):
(WebCore::FontCascadeFonts::realizeFallbackRangesAt):
(WebCore::findBestFallbackFont):
(WebCore::FontCascadeFonts::glyphDataForSystemFallback):
(WebCore::FontCascadeFonts::glyphDataForVariant):
(WebCore::FontCascadeFonts::glyphDataForCharacter):
(WebCore::operator<<):
* Source/WebCore/platform/graphics/FontCascadeFonts.h:
(WebCore::FontCascadeFonts::create):
(WebCore::FontCascadeFonts::isFixedPitch):
(WebCore::FontCascadeFonts::canTakeFixedPitchFastContentMeasuring):
(WebCore::FontCascadeFonts::primaryFont):
(WebCore::FontCascadeFonts::fontSelector): Deleted.
(WebCore::FontCascadeFonts::fontSelector const): Deleted.
(WebCore::FontCascadeFonts::fontSelectorVersion const): Deleted.
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::fontCascade):
* Source/WebCore/rendering/style/RenderStyle.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to