Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1693e2b8edc6ac2cdc07abcd87d90499250831f9
      
https://github.com/WebKit/WebKit/commit/1693e2b8edc6ac2cdc07abcd87d90499250831f9
  Author: Myles C. Maxfield <mmaxfi...@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/Configurations/WebCore.xcconfig:
* Source/WebCore/PAL/pal/spi/cf/CoreTextSPI.h:
* Source/WebCore/platform/graphics/coretext/FontCustomPlatformDataCoreText.cpp:
(WebCore::createFontCustomPlatformData):
* WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/101500/libFontParser.tbd: 
Added.
* WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/101600/libFontParser.tbd: 
Added.
* WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/110000/libFontParser.tbd: 
Added.
* WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/120000/libFontParser.tbd: 
Added.
* WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/130000/libFontParser.tbd: 
Added.
* WebKitLibraries/WebKitPrivateFrameworkStubs/appletvos/15/libFontParser.tbd: 
Added.
* WebKitLibraries/WebKitPrivateFrameworkStubs/appletvos/16/libFontParser.tbd: 
Added.
* WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/15/libFontParser.tbd: Added.
* WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/16/libFontParser.tbd: Added.
* WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/8/libFontParser.tbd: 
Added.
* WebKitLibraries/WebKitPrivateFrameworkStubs/watchos/9/libFontParser.tbd: 
Added.

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


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to