Changeset 92287 in webkit


Ignore:
Timestamp:
Aug 3, 2011, 9:46:13 AM (14 years ago)
Author:
mitz@apple.com
Message:

FontCache::getFontData() does not set the familyIndex to cAllFamiliesScanned if the last font is a custom font
https://bugs.webkit.org/show_bug.cgi?id=65597

Reviewed by Simon Fraser.

No test added because behavior is unchanged, but this saves a call to getFontData().

  • platform/graphics/FontCache.cpp:

(WebCore::FontCache::getFontData): Eliminated early return inside the loop, allowing execution
to continue and familyIndex to be set.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r92286 r92287  
     12011-08-03  Dan Bernstein  <mitz@apple.com>
     2
     3        FontCache::getFontData() does not set the familyIndex to cAllFamiliesScanned if the last font is a custom font
     4        https://bugs.webkit.org/show_bug.cgi?id=65597
     5
     6        Reviewed by Simon Fraser.
     7
     8        No test added because behavior is unchanged, but this saves a call to getFontData().
     9
     10        * platform/graphics/FontCache.cpp:
     11        (WebCore::FontCache::getFontData): Eliminated early return inside the loop, allowing execution
     12        to continue and familyIndex to be set.
     13
    1142011-08-03  Ryosuke Niwa  <rniwa@webkit.org>
    215
  • trunk/Source/WebCore/platform/graphics/FontCache.cpp

    r90700 r92287  
    395395const FontData* FontCache::getFontData(const Font& font, int& familyIndex, FontSelector* fontSelector)
    396396{
    397     SimpleFontData* result = 0;
     397    FontData* result = 0;
    398398
    399399    int startIndex = familyIndex;
     
    405405        familyIndex++;
    406406        if (currFamily->family().length()) {
    407             if (fontSelector) {
    408                 FontData* data = fontSelector->getFontData(font.fontDescription(), currFamily->family());
    409                 if (data)
    410                     return data;
    411             }
    412             result = getCachedFontData(font.fontDescription(), currFamily->family());
     407            if (fontSelector)
     408                result = fontSelector->getFontData(font.fontDescription(), currFamily->family());
     409
     410            if (!result)
     411                result = getCachedFontData(font.fontDescription(), currFamily->family());
    413412        }
    414413        currFamily = currFamily->next();
Note: See TracChangeset for help on using the changeset viewer.