OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Torch Mobile, Inc. | 3 * Copyright (C) 2009 Torch Mobile, Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 return FontPlatformData(size, bold, italic); | 95 return FontPlatformData(size, bold, italic); |
96 #endif | 96 #endif |
97 ASSERT(m_fontData); | 97 ASSERT(m_fontData); |
98 return m_fontData->fontPlatformData(static_cast<int>(size), bold, italic, or
ientation, widthVariant); | 98 return m_fontData->fontPlatformData(static_cast<int>(size), bold, italic, or
ientation, widthVariant); |
99 } | 99 } |
100 | 100 |
101 #if ENABLE(SVG_FONTS) | 101 #if ENABLE(SVG_FONTS) |
102 bool CachedFont::ensureSVGFontData() | 102 bool CachedFont::ensureSVGFontData() |
103 { | 103 { |
104 if (!m_externalSVGDocument && !errorOccurred() && !isLoading() && m_data) { | 104 if (!m_externalSVGDocument && !errorOccurred() && !isLoading() && m_data) { |
105 m_externalSVGDocument = SVGDocument::create(0, KURL()); | 105 m_externalSVGDocument = SVGDocument::create(); |
106 | 106 |
107 RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("appli
cation/xml"); | 107 RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("appli
cation/xml"); |
108 String svgSource = decoder->decode(m_data->data(), m_data->size()); | 108 String svgSource = decoder->decode(m_data->data(), m_data->size()); |
109 svgSource.append(decoder->flush()); | 109 svgSource.append(decoder->flush()); |
110 | 110 |
111 m_externalSVGDocument->setContent(svgSource); | 111 m_externalSVGDocument->setContent(svgSource); |
112 | 112 |
113 if (decoder->sawError()) | 113 if (decoder->sawError()) |
114 m_externalSVGDocument = 0; | 114 m_externalSVGDocument = 0; |
115 } | 115 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 { | 167 { |
168 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResou
rceFont); | 168 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResou
rceFont); |
169 CachedResource::reportMemoryUsage(memoryObjectInfo); | 169 CachedResource::reportMemoryUsage(memoryObjectInfo); |
170 #if ENABLE(SVG_FONTS) | 170 #if ENABLE(SVG_FONTS) |
171 info.addMember(m_externalSVGDocument, "externalSVGDocument"); | 171 info.addMember(m_externalSVGDocument, "externalSVGDocument"); |
172 #endif | 172 #endif |
173 info.addMember(m_fontData, "fontData"); | 173 info.addMember(m_fontData, "fontData"); |
174 } | 174 } |
175 | 175 |
176 } | 176 } |
OLD | NEW |