Changeset 190232 in webkit


Ignore:
Timestamp:
Sep 24, 2015 6:50:04 PM (9 years ago)
Author:
Chris Dumez
Message:

Unreviewed, roll out r187615 as it seems to have caused a ~1% PLT regression.
<rdar://problem/22657123>

  • platform/graphics/FontCache.h:

(WebCore::FontDescriptionKey::makeFlagsKey):

  • platform/graphics/FontCascade.cpp:

(WebCore::operator==):
(WebCore::makeFontSelectorFlags):
(WebCore::makeFontCascadeCacheKey):
(WebCore::computeFontCascadeCacheHash):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r190231 r190232  
     12015-09-24  Chris Dumez  <cdumez@apple.com>
     2
     3        Unreviewed, roll out r187615 as it seems to have caused a ~1% PLT regression.
     4        <rdar://problem/22657123>
     5
     6        * platform/graphics/FontCache.h:
     7        (WebCore::FontDescriptionKey::makeFlagsKey):
     8        * platform/graphics/FontCascade.cpp:
     9        (WebCore::operator==):
     10        (WebCore::makeFontSelectorFlags):
     11        (WebCore::makeFontCascadeCacheKey):
     12        (WebCore::computeFontCascadeCacheHash):
     13
    1142015-09-24  David Hyatt  <hyatt@apple.com>
    215
  • trunk/Source/WebCore/platform/graphics/FontCache.h

    r190192 r190232  
    113113    {
    114114        static_assert(USCRIPT_CODE_LIMIT < 0x1000, "Script code must fit in an unsigned along with the other flags");
    115         unsigned first = static_cast<unsigned>(description.script()) << 11
    116             | static_cast<unsigned>(description.textRenderingMode()) << 9
    117             | static_cast<unsigned>(description.smallCaps()) << 8
    118             | static_cast<unsigned>(description.fontSynthesis()) << 6
     115        unsigned first = static_cast<unsigned>(description.textRenderingMode()) << 6
    119116            | static_cast<unsigned>(description.widthVariant()) << 4
    120117            | static_cast<unsigned>(description.nonCJKGlyphOrientation()) << 3
  • trunk/Source/WebCore/platform/graphics/FontCascade.cpp

    r190192 r190232  
    184184    unsigned fontSelectorId;
    185185    unsigned fontSelectorVersion;
     186    unsigned fontSelectorFlags;
    186187};
    187188
     
    203204    if (a.fontDescriptionKey != b.fontDescriptionKey)
    204205        return false;
    205     if (a.fontSelectorId != b.fontSelectorId || a.fontSelectorVersion != b.fontSelectorVersion)
     206    if (a.fontSelectorId != b.fontSelectorId || a.fontSelectorVersion != b.fontSelectorVersion|| a.fontSelectorFlags != b.fontSelectorFlags)
    206207        return false;
    207208    if (a.families.size() != b.families.size())
     
    229230    for (auto& value : fontCascadeCache().values())
    230231        value->fonts.get().widthCache().clear();
     232}
     233
     234static unsigned makeFontSelectorFlags(const FontDescription& description)
     235{
     236    return static_cast<unsigned>(description.script()) << 1 | static_cast<unsigned>(description.smallCaps());
    231237}
    232238
     
    239245    key.fontSelectorId = fontSelector ? fontSelector->uniqueId() : 0;
    240246    key.fontSelectorVersion = fontSelector ? fontSelector->version() : 0;
     247    key.fontSelectorFlags = fontSelector && fontSelector->resolvesFamilyFor(description) ? makeFontSelectorFlags(description) : 0;
    241248    return key;
    242249}
     
    251258    hashCodes.uncheckedAppend(key.fontSelectorId);
    252259    hashCodes.uncheckedAppend(key.fontSelectorVersion);
     260    hashCodes.uncheckedAppend(key.fontSelectorFlags);
    253261    for (unsigned i = 0; i < key.families.size(); ++i)
    254262        hashCodes.uncheckedAppend(key.families[i].impl() ? CaseFoldingHash::hash(key.families[i]) : 0);
Note: See TracChangeset for help on using the changeset viewer.