OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 * | 18 * |
19 */ | 19 */ |
20 | 20 |
21 #ifndef FontFallbackList_h | 21 #ifndef FontFallbackList_h |
22 #define FontFallbackList_h | 22 #define FontFallbackList_h |
23 | 23 |
24 #include "platform/fonts/FontSelector.h" | 24 #include "platform/fonts/FontSelector.h" |
25 #include "platform/fonts/SimpleFontData.h" | 25 #include "platform/fonts/SimpleFontData.h" |
26 #include "platform/fonts/WidthCache.h" | 26 #include "platform/fonts/shaping/CachingWordShaper.h" |
27 #include "wtf/Forward.h" | 27 #include "wtf/Forward.h" |
28 #include "wtf/MainThread.h" | 28 #include "wtf/MainThread.h" |
29 | 29 |
30 namespace blink { | 30 namespace blink { |
31 | 31 |
32 class GlyphPageTreeNodeBase; | 32 class GlyphPageTreeNodeBase; |
33 class FontDescription; | 33 class FontDescription; |
34 | 34 |
35 const int cAllFamiliesScanned = -1; | 35 const int cAllFamiliesScanned = -1; |
36 | 36 |
(...skipping 30 matching lines...) Expand all Loading... |
67 void invalidate(PassRefPtrWillBeRawPtr<FontSelector>); | 67 void invalidate(PassRefPtrWillBeRawPtr<FontSelector>); |
68 | 68 |
69 bool loadingCustomFonts() const; | 69 bool loadingCustomFonts() const; |
70 bool shouldSkipDrawing() const; | 70 bool shouldSkipDrawing() const; |
71 | 71 |
72 FontSelector* fontSelector() const { return m_fontSelector.get(); } | 72 FontSelector* fontSelector() const { return m_fontSelector.get(); } |
73 // FIXME: It should be possible to combine fontSelectorVersion and generatio
n. | 73 // FIXME: It should be possible to combine fontSelectorVersion and generatio
n. |
74 unsigned fontSelectorVersion() const { return m_fontSelectorVersion; } | 74 unsigned fontSelectorVersion() const { return m_fontSelectorVersion; } |
75 unsigned generation() const { return m_generation; } | 75 unsigned generation() const { return m_generation; } |
76 | 76 |
77 WidthCache& widthCache() const { return m_widthCache; } | 77 CachingWordShaper& cachingWordShaper() const { return m_cachingWordShaper; } |
78 | 78 |
79 const SimpleFontData* primarySimpleFontData(const FontDescription& fontDescr
iption) | 79 const SimpleFontData* primarySimpleFontData(const FontDescription& fontDescr
iption) |
80 { | 80 { |
81 ASSERT(isMainThread()); | 81 ASSERT(isMainThread()); |
82 if (!m_cachedPrimarySimpleFontData) | 82 if (!m_cachedPrimarySimpleFontData) |
83 m_cachedPrimarySimpleFontData = determinePrimarySimpleFontData(fontD
escription); | 83 m_cachedPrimarySimpleFontData = determinePrimarySimpleFontData(fontD
escription); |
84 return m_cachedPrimarySimpleFontData; | 84 return m_cachedPrimarySimpleFontData; |
85 } | 85 } |
86 const FontData* fontDataAt(const FontDescription&, unsigned index) const; | 86 const FontData* fontDataAt(const FontDescription&, unsigned index) const; |
87 | 87 |
(...skipping 17 matching lines...) Expand all Loading... |
105 | 105 |
106 const SimpleFontData* determinePrimarySimpleFontData(const FontDescription&)
const; | 106 const SimpleFontData* determinePrimarySimpleFontData(const FontDescription&)
const; |
107 | 107 |
108 void releaseFontData(); | 108 void releaseFontData(); |
109 | 109 |
110 mutable Vector<RefPtr<FontData>, 1> m_fontList; | 110 mutable Vector<RefPtr<FontData>, 1> m_fontList; |
111 GlyphPages m_pages; | 111 GlyphPages m_pages; |
112 GlyphPageTreeNodeBase* m_pageZero; | 112 GlyphPageTreeNodeBase* m_pageZero; |
113 mutable const SimpleFontData* m_cachedPrimarySimpleFontData; | 113 mutable const SimpleFontData* m_cachedPrimarySimpleFontData; |
114 RefPtrWillBePersistent<FontSelector> m_fontSelector; | 114 RefPtrWillBePersistent<FontSelector> m_fontSelector; |
115 mutable WidthCache m_widthCache; | 115 mutable CachingWordShaper m_cachingWordShaper; |
116 unsigned m_fontSelectorVersion; | 116 unsigned m_fontSelectorVersion; |
117 mutable int m_familyIndex; | 117 mutable int m_familyIndex; |
118 unsigned short m_generation; | 118 unsigned short m_generation; |
119 mutable bool m_hasLoadingFallback : 1; | 119 mutable bool m_hasLoadingFallback : 1; |
120 }; | 120 }; |
121 | 121 |
122 } // namespace blink | 122 } // namespace blink |
123 | 123 |
124 #endif | 124 #endif |
OLD | NEW |