Changeset 200921 in webkit for trunk/Source/WebCore/css/CSSFontFaceSource.cpp
- Timestamp:
- May 14, 2016, 12:18:34 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/css/CSSFontFaceSource.cpp
r199830 r200921 35 35 #include "Font.h" 36 36 #include "FontCache.h" 37 #include "FontCustomPlatformData.h" 37 38 #include "FontDescription.h" 38 39 #include "FontCustomPlatformData.h"40 39 #include "SVGToOTFFontConversion.h" 41 40 … … 70 69 } 71 70 72 CSSFontFaceSource::CSSFontFaceSource(CSSFontFace& owner, const String& familyNameOrURI, CachedFont* font, SVGFontFaceElement* fontFace )71 CSSFontFaceSource::CSSFontFaceSource(CSSFontFace& owner, const String& familyNameOrURI, CachedFont* font, SVGFontFaceElement* fontFace, RefPtr<JSC::ArrayBufferView>&& arrayBufferView) 73 72 : m_familyNameOrURI(familyNameOrURI) 74 73 , m_font(font) 75 74 , m_face(owner) 75 , m_immediateSource(WTFMove(arrayBufferView)) 76 76 #if ENABLE(SVG_FONTS) 77 77 , m_svgFontFaceElement(fontFace) … … 138 138 139 139 if (!m_font && !fontFaceElement) { 140 if (m_immediateSource) { 141 if (!m_immediateFontCustomPlatformData) { 142 bool wrapping; 143 RefPtr<SharedBuffer> buffer = SharedBuffer::create(static_cast<const char*>(m_immediateSource->baseAddress()), m_immediateSource->byteLength()); 144 ASSERT(buffer); 145 m_immediateFontCustomPlatformData = CachedFont::createCustomFontData(*buffer, wrapping); 146 } if (!m_immediateFontCustomPlatformData) 147 return nullptr; 148 return Font::create(CachedFont::platformDataFromCustomData(*m_immediateFontCustomPlatformData, fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings), true); 149 } 150 140 151 // We're local. Just return a Font from the normal cache. 141 152 // We don't want to check alternate font family names here, so pass true as the checkingAlternateName parameter.
Note:
See TracChangeset
for help on using the changeset viewer.