FontCache should only deal with SimpleFontData
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jan 2015 19:33:40 +0000 (19:33 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jan 2015 19:33:40 +0000 (19:33 +0000)
commitc549649b5d83c1dd80e5acc03f8a7c7643ab4103
tree401e72944119958fcef826c413cc5c6154abd403
parent7d03223f46d56c500e2679413adab39aef048656
FontCache should only deal with SimpleFontData
https://bugs.webkit.org/show_bug.cgi?id=140293

Reviewed by Andreas Kling.

FontCache::fontForFamilyAtIndex hands out FontData objects and calls to FontSelector. That sort
of code does not belong to the cache layer. Move the functionality up to FontGlyphs.

* platform/graphics/Font.cpp:
(WebCore::Font::operator==):
(WebCore::Font::drawText):
(WebCore::Font::drawEmphasisMarks):
(WebCore::Font::isLoadingCustomFonts):
* platform/graphics/Font.h:
(WebCore::Font::loadingCustomFonts): Deleted.
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::similarFontPlatformData):

    Generic null implementation to reduce #ifs.

(WebCore::FontCache::fontForFamilyAtIndex): Deleted.
* platform/graphics/FontCache.h:

    Unfriend FontGlyphs.

* platform/graphics/FontGlyphs.cpp:
(WebCore::FontGlyphs::FontGlyphs):
(WebCore::FontGlyphs::isLoadingCustomFonts):

    We can figure thus out cheaply without caching a bit.

(WebCore::realizeNextFamily):
(WebCore::FontGlyphs::realizeFontDataAt):

    Reorganize a bit to make the logic clearer.
    Get rid of the strange cAllFamiliesScanned constant.

(WebCore::FontGlyphs::glyphDataForVariant):
(WebCore::FontGlyphs::glyphDataForNormalVariant):

    Loop until null, that always works.

* platform/graphics/FontGlyphs.h:
(WebCore::FontGlyphs::loadingCustomFonts): Deleted.
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::FontCache::similarFontPlatformData):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::similarFontPlatformData):
* platform/graphics/mac/FontMac.mm:
(WebCore::Font::dashesForIntersectionsWithRect):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Font.cpp
Source/WebCore/platform/graphics/Font.h
Source/WebCore/platform/graphics/FontCache.cpp
Source/WebCore/platform/graphics/FontCache.h
Source/WebCore/platform/graphics/FontGlyphs.cpp
Source/WebCore/platform/graphics/FontGlyphs.h
Source/WebCore/platform/graphics/cairo/FontCairo.cpp
Source/WebCore/platform/graphics/ios/FontCacheIOS.mm
Source/WebCore/platform/graphics/mac/FontCacheMac.mm
Source/WebCore/platform/graphics/mac/FontMac.mm