Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: Source/platform/fonts/FontCache.h

Issue 99103006: Moving GraphicsContext and dependencies from core to platform. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Final patch - fixes Android Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | Source/platform/fonts/FontCache.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13 matching lines...) Expand all
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30 #ifndef FontCache_h 30 #ifndef FontCache_h
31 #define FontCache_h 31 #define FontCache_h
32 32
33 #include <limits.h> 33 #include <limits.h>
34 #include "platform/PlatformExport.h"
34 #include "wtf/Forward.h" 35 #include "wtf/Forward.h"
35 #include "wtf/PassRefPtr.h" 36 #include "wtf/PassRefPtr.h"
36 #include "wtf/RefPtr.h" 37 #include "wtf/RefPtr.h"
37 #include "wtf/Vector.h" 38 #include "wtf/Vector.h"
38 #include "wtf/text/CString.h" 39 #include "wtf/text/CString.h"
39 #include "wtf/text/WTFString.h" 40 #include "wtf/text/WTFString.h"
40 #include "wtf/unicode/Unicode.h" 41 #include "wtf/unicode/Unicode.h"
41 42
42 #if OS(WIN) 43 #if OS(WIN)
43 #include <windows.h> 44 #include <windows.h>
(...skipping 12 matching lines...) Expand all
56 class FontPlatformData; 57 class FontPlatformData;
57 class FontData; 58 class FontData;
58 class FontDescription; 59 class FontDescription;
59 class FontSelector; 60 class FontSelector;
60 class OpenTypeVerticalData; 61 class OpenTypeVerticalData;
61 class SimpleFontData; 62 class SimpleFontData;
62 63
63 enum ShouldRetain { Retain, DoNotRetain }; 64 enum ShouldRetain { Retain, DoNotRetain };
64 enum PurgeSeverity { PurgeIfNeeded, ForcePurge }; 65 enum PurgeSeverity { PurgeIfNeeded, ForcePurge };
65 66
66 class FontCache { 67 class PLATFORM_EXPORT FontCache {
67 friend class FontCachePurgePreventer; 68 friend class FontCachePurgePreventer;
68 69
69 WTF_MAKE_NONCOPYABLE(FontCache); WTF_MAKE_FAST_ALLOCATED; 70 WTF_MAKE_NONCOPYABLE(FontCache); WTF_MAKE_FAST_ALLOCATED;
70 public: 71 public:
71 friend FontCache* fontCache(); 72 static FontCache* fontCache();
72 73
73 void releaseFontData(const SimpleFontData*); 74 void releaseFontData(const SimpleFontData*);
74 75
75 // This method is implemented by the plaform and used by 76 // This method is implemented by the plaform and used by
76 // FontFastPath to lookup the font for a given character. 77 // FontFastPath to lookup the font for a given character.
77 PassRefPtr<SimpleFontData> platformFallbackForCharacter(const FontDescriptio n&, UChar32, const SimpleFontData* fontDataToSubstitute, bool disallowSynthetics ); 78 PassRefPtr<SimpleFontData> platformFallbackForCharacter(const FontDescriptio n&, UChar32, const SimpleFontData* fontDataToSubstitute, bool disallowSynthetics );
78 79
79 // Also implemented by the platform. 80 // Also implemented by the platform.
80 void platformInit(); 81 void platformInit();
81 82
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 bool m_useSubpixelPositioning; 144 bool m_useSubpixelPositioning;
144 #endif 145 #endif
145 146
146 #if OS(MACOSX) || OS(ANDROID) 147 #if OS(MACOSX) || OS(ANDROID)
147 friend class ComplexTextController; 148 friend class ComplexTextController;
148 #endif 149 #endif
149 friend class SimpleFontData; // For fontDataFromFontPlatformData 150 friend class SimpleFontData; // For fontDataFromFontPlatformData
150 friend class FontFallbackList; 151 friend class FontFallbackList;
151 }; 152 };
152 153
153 // Get the global fontCache. 154 class PLATFORM_EXPORT FontCachePurgePreventer {
154 FontCache* fontCache();
155
156 class FontCachePurgePreventer {
157 public: 155 public:
158 FontCachePurgePreventer() { fontCache()->disablePurging(); } 156 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); }
159 ~FontCachePurgePreventer() { fontCache()->enablePurging(); } 157 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); }
160 }; 158 };
161 159
162 } 160 }
163 161
164 #endif 162 #endif
OLDNEW
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | Source/platform/fonts/FontCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698