Improve the performance of Font::canRenderCombiningCharacterSequence()
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 May 2018 03:44:49 +0000 (03:44 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 May 2018 03:44:49 +0000 (03:44 +0000)
commit6b93396e7e21524a3b2864e2ecaa119d180cd206
tree218d5198b8a115a77ca08f17d7bb6528f2720cff
parent7cb5d5400a7778e972057c4fad2e6680f01446be
Improve the performance of Font::canRenderCombiningCharacterSequence()
https://bugs.webkit.org/show_bug.cgi?id=185933

Reviewed by Ryosuke Niwa.

PerformanceTests:

* Layout/ComplexLongUnique.html: Added.

Source/WebCore:

We don't need to create a whole CTLine just to determine whether or not a font supports rendering a grapheme cluster.
Instead, the right way to do it is just see if the font's cmap table supports every code point in the cluster.

This patch reports a 2% progression on the attached PerformanceTest.

Test: Layout/ComplexLongUnique.html

* platform/graphics/Font.cpp:
(WebCore::Font::canRenderCombiningCharacterSequence const):
* platform/graphics/Font.h:
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::provideStringAndAttributes): Deleted.
(WebCore::Font::canRenderCombiningCharacterSequence const): Deleted.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::canRenderCombiningCharacterSequence const): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PerformanceTests/ChangeLog
PerformanceTests/Layout/ComplexLongUnique.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Font.cpp
Source/WebCore/platform/graphics/Font.h
Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp