OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "core/svg/SVGVKernElement.h" | 32 #include "core/svg/SVGVKernElement.h" |
33 #include "wtf/ASCIICType.h" | 33 #include "wtf/ASCIICType.h" |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 inline SVGFontElement::SVGFontElement(Document& document) | 37 inline SVGFontElement::SVGFontElement(Document& document) |
38 : SVGElement(SVGNames::fontTag, document) | 38 : SVGElement(SVGNames::fontTag, document) |
39 , m_missingGlyph(0) | 39 , m_missingGlyph(0) |
40 , m_isGlyphCacheValid(false) | 40 , m_isGlyphCacheValid(false) |
41 { | 41 { |
42 ScriptWrappable::init(this); | |
43 | |
44 UseCounter::count(document, UseCounter::SVGFontElement); | 42 UseCounter::count(document, UseCounter::SVGFontElement); |
45 } | 43 } |
46 | 44 |
47 DEFINE_NODE_FACTORY(SVGFontElement) | 45 DEFINE_NODE_FACTORY(SVGFontElement) |
48 | 46 |
49 void SVGFontElement::invalidateGlyphCache() | 47 void SVGFontElement::invalidateGlyphCache() |
50 { | 48 { |
51 if (m_isGlyphCacheValid) { | 49 if (m_isGlyphCacheValid) { |
52 m_glyphMap.clear(); | 50 m_glyphMap.clear(); |
53 m_horizontalKerningTable.clear(); | 51 m_horizontalKerningTable.clear(); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 ensureGlyphCache(); | 242 ensureGlyphCache(); |
245 return m_glyphMap.svgGlyphForGlyph(glyph); | 243 return m_glyphMap.svgGlyphForGlyph(glyph); |
246 } | 244 } |
247 | 245 |
248 Glyph SVGFontElement::missingGlyph() | 246 Glyph SVGFontElement::missingGlyph() |
249 { | 247 { |
250 ensureGlyphCache(); | 248 ensureGlyphCache(); |
251 return m_missingGlyph; | 249 return m_missingGlyph; |
252 } | 250 } |
253 | 251 |
254 } | 252 } // namespace blink |
255 | 253 |
256 #endif // ENABLE(SVG_FONTS) | 254 #endif // ENABLE(SVG_FONTS) |
OLD | NEW |