[webkit-changes] [WebKit/WebKit] 1dda08: [Win Skia] Loading tests fonts for WebKitTestRunner

Fujii Hironori noreply at github.com
Thu Dec 12 15:59:36 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1dda088dce596bde633affd7263c10d19facc044
      https://github.com/WebKit/WebKit/commit/1dda088dce596bde633affd7263c10d19facc044
  Author: Fujii Hironori <Hironori.Fujii at sony.com>
  Date:   2024-12-12 (Thu, 12 Dec 2024)

  Changed paths:
    M Source/WebCore/PlatformWin.cmake
    M Source/WebCore/platform/graphics/FontCache.h
    M Source/WebCore/platform/graphics/skia/FontCacheSkia.cpp
    A Source/WebCore/platform/graphics/win/FontCacheSkiaWin.cpp
    M Tools/WebKitTestRunner/InjectedBundle/win/ActivateFontsWin.cpp

  Log Message:
  -----------
  [Win Skia] Loading tests fonts for WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=284575

Reviewed by Don Olmstead.

A lot of layout tests were failing for Windows Skia port because the
bundled Ahem font wasn't loaded for WebKitTestRunner.

Windows Cairo port is using a Windows GDI API AddFontResourceExW to
load tests fonts for WebKitTestRunner in web process. However, this
doesn't work for Windows Skia port because it is using DirectWrite to
find a font. It should create an IDWriteFontCollection which contains
the test fonts.

Windows Cairo port is using the injected bundle to load the test fonts
in web process. However, this is a problem for GPU process mode. They
should be loaded in GPU process. That's the reason why it still
disables DOM rendering in GPU process. <https://webkit.org/b/278895>

In this change, WebCore::FontCache loads the test fonts if
"WEBKIT_TESTFONTS" environment variable is specified. I confirmed this
approach works as expected even after enabling DOM rendering in GPU
process for WebKitTestRunner.

* Source/WebCore/PlatformWin.cmake:
* Source/WebCore/platform/graphics/FontCache.h:
* Source/WebCore/platform/graphics/skia/FontCacheSkia.cpp:
(WebCore::FontCache::platformInit):
(WebCore::FontCache::fontManager const):
* Source/WebCore/platform/graphics/win/FontCacheSkiaWin.cpp: Added.
(WebCore::fontsPath):
(WebCore::FontCache::createDWriteFactory):
* Tools/WebKitTestRunner/InjectedBundle/win/ActivateFontsWin.cpp:
(WTR::activateFonts):

Canonical link: https://commits.webkit.org/287769@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