[webkit-changes] [WebKit/WebKit] 21ab6b: [Cocoa] [GPUP] Compressed fonts are decompressed t...

Myles C. Maxfield noreply at github.com
Wed May 31 02:25:08 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 21ab6bc788f21a099b61fa1ead9f7ba048d7c687
      https://github.com/WebKit/WebKit/commit/21ab6bc788f21a099b61fa1ead9f7ba048d7c687
  Author: Myles C. Maxfield <mmaxfield at apple.com>
  Date:   2023-05-31 (Wed, 31 May 2023)

  Changed paths:
    M Source/WebCore/Configurations/WebCore.xcconfig
    M Source/WebCore/PAL/pal/spi/cf/CoreTextSPI.h
    M Source/WebCore/platform/graphics/coretext/FontCustomPlatformDataCoreText.cpp
    A WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/101500/libFontParser.tbd
    A WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/101600/libFontParser.tbd
    A WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/110000/libFontParser.tbd
    A WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/120000/libFontParser.tbd
    A WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/130000/libFontParser.tbd
    A WebKitLibraries/WebKitPrivateFrameworkStubs/appletvos/15/libFontParser.tbd
    A WebKitLibraries/WebKitPrivateFrameworkStubs/appletvos/16/libFontParser.tbd
    A WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/15/libFontParser.tbd
    A WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/libFontParser.tbd
    A WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/8/libFontParser.tbd
    A WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/9/libFontParser.tbd

  Log Message:
  -----------
  [Cocoa] [GPUP] Compressed fonts are decompressed twice, which is one too many times
https://bugs.webkit.org/show_bug.cgi?id=257401
rdar://109910582

Reviewed by David Kilzer.

Previously, the way we were sharing web fonts between the web process and the GPU process is
by simply transferring the bytes of the file, and asking Core Text to open the data. Both
processes need to use the font, so this means Core Text was being asked to open the data twice.
This actually has somewhat significant cost, as many fonts are compressed, and simply opening
it has to decompress the file.

This patch uses an SPI function to produce the decompressed bytes, without opening the font.
This allows us to retain the decompressed bytes, and send them to the GPU process. By
decompressing early, we can decompress once, and then use the decompressed bytes everywhere.
This means we only have to decompress fonts once.

* Source/WebCore/PAL/pal/spi/cf/CoreTextSPI.h:
* Source/WebCore/platform/graphics/coretext/FontCustomPlatformDataCoreText.cpp:
(WebCore::createFontCustomPlatformData):

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




More information about the webkit-changes mailing list