Ignore:
Timestamp:
Jan 22, 2015, 1:57:04 PM (10 years ago)
Author:
Antti Koivisto
Message:

Rename SimpleFontData to Font
https://bugs.webkit.org/show_bug.cgi?id=140496

Reviewed by Zalan Bujtas.

The fallback supporting Font type was renamed FontCascade.
We can now rename SimpleFontData to Font matching the usual definition.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/CSSFontFaceSource.cpp

    r178292 r178940  
    3333#include "Document.h"
    3434#include "ElementIterator.h"
     35#include "Font.h"
    3536#include "FontCache.h"
    3637#include "FontDescription.h"
    37 #include "SimpleFontData.h"
    3838
    3939#if ENABLE(SVG_OTF_CONVERTER)
     
    7575void CSSFontFaceSource::pruneTable()
    7676{
    77     if (m_fontDataTable.isEmpty())
     77    if (m_fontTable.isEmpty())
    7878        return;
    7979
    80     m_fontDataTable.clear();
     80    m_fontTable.clear();
    8181}
    8282
     
    102102}
    103103
    104 PassRefPtr<SimpleFontData> CSSFontFaceSource::getFontData(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, CSSFontSelector* fontSelector)
     104RefPtr<Font> CSSFontFaceSource::font(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, CSSFontSelector* fontSelector)
    105105{
    106106    // If the font hasn't loaded or an error occurred, then we've got nothing.
     
    113113#endif
    114114    ) {
    115         // We're local. Just return a SimpleFontData from the normal cache.
     115        // We're local. Just return a Font from the normal cache.
    116116        // We don't want to check alternate font family names here, so pass true as the checkingAlternateName parameter.
    117117        return fontCache().fontForFamily(fontDescription, m_string, true);
    118118    }
    119119
    120     // See if we have a mapping in our FontData cache.
    121120    unsigned hashKey = (fontDescription.computedPixelSize() + 1) << 5 | fontDescription.widthVariant() << 3
    122121                       | (fontDescription.orientation() == Vertical ? 4 : 0) | (syntheticBold ? 2 : 0) | (syntheticItalic ? 1 : 0);
    123122
    124     RefPtr<SimpleFontData> fontData = m_fontDataTable.add(hashKey, nullptr).iterator->value;
    125     if (fontData)
    126         return fontData.release();
     123    RefPtr<Font> font = m_fontTable.add(hashKey, nullptr).iterator->value;
     124    if (font)
     125        return font.release();
    127126
    128127    // If we are still loading, then we let the system pick a font.
     
    137136                return nullptr;
    138137
    139             fontData = m_font->getFontData(fontDescription, m_string, syntheticBold, syntheticItalic, hasExternalSVGFont);
     138            font = m_font->createFont(fontDescription, m_string, syntheticBold, syntheticItalic, hasExternalSVGFont);
    140139        } else {
    141140#if ENABLE(SVG_FONTS)
     
    153152                    return nullptr;
    154153                std::unique_ptr<FontCustomPlatformData> customPlatformData = createFontCustomPlatformData(*m_generatedOTFBuffer);
    155                 fontData = SimpleFontData::create(customPlatformData->fontPlatformData(static_cast<int>(fontDescription.computedPixelSize()), syntheticBold, syntheticItalic, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.renderingMode()), true, false);
     154                font = Font::create(customPlatformData->fontPlatformData(static_cast<int>(fontDescription.computedPixelSize()), syntheticBold, syntheticItalic, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.renderingMode()), true, false);
    156155#else
    157                 fontData = SimpleFontData::create(std::make_unique<SVGFontData>(m_svgFontFaceElement.get()), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
     156                font = Font::create(std::make_unique<SVGFontData>(m_svgFontFaceElement.get()), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
    158157#endif
    159158            }
     
    165164        fontSelector->beginLoadingFontSoon(m_font.get());
    166165
    167         Ref<SimpleFontData> placeholderFont = fontCache().lastResortFallbackFont(fontDescription);
    168         Ref<SimpleFontData> placeholderFontCopyInLoadingState = SimpleFontData::create(placeholderFont->platformData(), true, true);
     166        Ref<Font> placeholderFont = fontCache().lastResortFallbackFont(fontDescription);
     167        Ref<Font> placeholderFontCopyInLoadingState = Font::create(placeholderFont->platformData(), true, true);
    169168        return WTF::move(placeholderFontCopyInLoadingState);
    170169    }
    171170
    172     return fontData.release();
     171    return font.release();
    173172}
    174173
Note: See TracChangeset for help on using the changeset viewer.