OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) 2007-2008 Torch Mobile, Inc. | 3 * Copyright (C) 2007-2008 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 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 #include <limits.h> | 33 #include <limits.h> |
34 #include "wtf/Forward.h" | 34 #include "wtf/Forward.h" |
35 #include "wtf/PassRefPtr.h" | 35 #include "wtf/PassRefPtr.h" |
36 #include "wtf/RefPtr.h" | 36 #include "wtf/RefPtr.h" |
37 #include "wtf/Vector.h" | 37 #include "wtf/Vector.h" |
38 #include "wtf/text/CString.h" | 38 #include "wtf/text/CString.h" |
39 #include "wtf/text/WTFString.h" | 39 #include "wtf/text/WTFString.h" |
40 #include "wtf/unicode/Unicode.h" | 40 #include "wtf/unicode/Unicode.h" |
41 | 41 |
42 #if OS(WINDOWS) | 42 #if OS(WIN) |
43 #include <windows.h> | 43 #include <windows.h> |
44 #include <objidl.h> | 44 #include <objidl.h> |
45 #include <mlang.h> | 45 #include <mlang.h> |
46 #endif | 46 #endif |
47 | 47 |
48 #if OS(WINDOWS) && !ENABLE(GDI_FONTS_ON_WINDOWS) | 48 #if OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS) |
49 #include "SkFontMgr.h" | 49 #include "SkFontMgr.h" |
50 #endif | 50 #endif |
51 | 51 |
52 class SkTypeface; | 52 class SkTypeface; |
53 | 53 |
54 namespace WebCore { | 54 namespace WebCore { |
55 | 55 |
56 class Font; | 56 class Font; |
57 class FontPlatformData; | 57 class FontPlatformData; |
58 class FontData; | 58 class FontData; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 void addClient(FontSelector*); | 90 void addClient(FontSelector*); |
91 void removeClient(FontSelector*); | 91 void removeClient(FontSelector*); |
92 | 92 |
93 unsigned short generation(); | 93 unsigned short generation(); |
94 void invalidate(); | 94 void invalidate(); |
95 | 95 |
96 size_t fontDataCount(); | 96 size_t fontDataCount(); |
97 size_t inactiveFontDataCount(); | 97 size_t inactiveFontDataCount(); |
98 void purgeInactiveFontData(int count = INT_MAX); | 98 void purgeInactiveFontData(int count = INT_MAX); |
99 | 99 |
100 #if OS(WINDOWS) | 100 #if OS(WIN) |
101 PassRefPtr<SimpleFontData> fontDataFromDescriptionAndLogFont(const FontDescr
iption&, ShouldRetain, const LOGFONT&, wchar_t* outFontFamilyName); | 101 PassRefPtr<SimpleFontData> fontDataFromDescriptionAndLogFont(const FontDescr
iption&, ShouldRetain, const LOGFONT&, wchar_t* outFontFamilyName); |
102 #endif | 102 #endif |
103 | 103 |
104 #if ENABLE(OPENTYPE_VERTICAL) | 104 #if ENABLE(OPENTYPE_VERTICAL) |
105 typedef uint32_t FontFileKey; | 105 typedef uint32_t FontFileKey; |
106 PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const F
ontPlatformData&); | 106 PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const F
ontPlatformData&); |
107 #endif | 107 #endif |
108 | 108 |
109 struct SimpleFontFamily { | 109 struct SimpleFontFamily { |
110 String name; | 110 String name; |
(...skipping 25 matching lines...) Expand all Loading... |
136 | 136 |
137 // Implemented on skia platforms. | 137 // Implemented on skia platforms. |
138 SkTypeface* createTypeface(const FontDescription&, const AtomicString& famil
y, CString& name); | 138 SkTypeface* createTypeface(const FontDescription&, const AtomicString& famil
y, CString& name); |
139 | 139 |
140 PassRefPtr<SimpleFontData> getFontResourceData(const FontPlatformData*, Shou
ldRetain = Retain); | 140 PassRefPtr<SimpleFontData> getFontResourceData(const FontPlatformData*, Shou
ldRetain = Retain); |
141 const FontPlatformData* getFallbackFontData(const FontDescription&); | 141 const FontPlatformData* getFallbackFontData(const FontDescription&); |
142 | 142 |
143 // Don't purge if this count is > 0; | 143 // Don't purge if this count is > 0; |
144 int m_purgePreventCount; | 144 int m_purgePreventCount; |
145 | 145 |
146 #if OS(WINDOWS) && !ENABLE(GDI_FONTS_ON_WINDOWS) | 146 #if OS(WIN) && !ENABLE(GDI_FONTS_ON_WINDOWS) |
147 OwnPtr<SkFontMgr> m_fontManager; | 147 OwnPtr<SkFontMgr> m_fontManager; |
148 #endif | 148 #endif |
149 | 149 |
150 #if OS(MACOSX) || OS(ANDROID) | 150 #if OS(MACOSX) || OS(ANDROID) |
151 friend class ComplexTextController; | 151 friend class ComplexTextController; |
152 #endif | 152 #endif |
153 friend class SimpleFontData; // For getFontResourceData(const FontPlatformDa
ta*) | 153 friend class SimpleFontData; // For getFontResourceData(const FontPlatformDa
ta*) |
154 friend class FontFallbackList; | 154 friend class FontFallbackList; |
155 }; | 155 }; |
156 | 156 |
157 // Get the global fontCache. | 157 // Get the global fontCache. |
158 FontCache* fontCache(); | 158 FontCache* fontCache(); |
159 | 159 |
160 class FontCachePurgePreventer { | 160 class FontCachePurgePreventer { |
161 public: | 161 public: |
162 FontCachePurgePreventer() { fontCache()->disablePurging(); } | 162 FontCachePurgePreventer() { fontCache()->disablePurging(); } |
163 ~FontCachePurgePreventer() { fontCache()->enablePurging(); } | 163 ~FontCachePurgePreventer() { fontCache()->enablePurging(); } |
164 }; | 164 }; |
165 | 165 |
166 } | 166 } |
167 | 167 |
168 #endif | 168 #endif |
OLD | NEW |