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

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

Issue 1757703003: Extend FontCache fallback API to support FontFallbackPriority (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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
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 16 matching lines...) Expand all
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 "platform/PlatformExport.h" 33 #include "platform/PlatformExport.h"
34 #include "platform/fonts/FallbackListCompositeKey.h" 34 #include "platform/fonts/FallbackListCompositeKey.h"
35 #include "platform/fonts/FontCacheKey.h" 35 #include "platform/fonts/FontCacheKey.h"
36 #include "platform/fonts/FontFaceCreationParams.h" 36 #include "platform/fonts/FontFaceCreationParams.h"
37 #include "platform/fonts/FontFallbackPriority.h"
37 #include "wtf/Allocator.h" 38 #include "wtf/Allocator.h"
38 #include "wtf/Forward.h" 39 #include "wtf/Forward.h"
39 #include "wtf/HashMap.h" 40 #include "wtf/HashMap.h"
40 #include "wtf/PassRefPtr.h" 41 #include "wtf/PassRefPtr.h"
41 #include "wtf/RefPtr.h" 42 #include "wtf/RefPtr.h"
42 #include "wtf/text/CString.h" 43 #include "wtf/text/CString.h"
43 #include "wtf/text/Unicode.h" 44 #include "wtf/text/Unicode.h"
44 #include "wtf/text/WTFString.h" 45 #include "wtf/text/WTFString.h"
45 #include <limits.h> 46 #include <limits.h>
46 47
(...skipping 21 matching lines...) Expand all
68 friend class FontCachePurgePreventer; 69 friend class FontCachePurgePreventer;
69 70
70 WTF_MAKE_NONCOPYABLE(FontCache); USING_FAST_MALLOC(FontCache); 71 WTF_MAKE_NONCOPYABLE(FontCache); USING_FAST_MALLOC(FontCache);
71 public: 72 public:
72 static FontCache* fontCache(); 73 static FontCache* fontCache();
73 74
74 void releaseFontData(const SimpleFontData*); 75 void releaseFontData(const SimpleFontData*);
75 76
76 // This method is implemented by the plaform and used by 77 // This method is implemented by the plaform and used by
77 // FontFastPath to lookup the font for a given character. 78 // FontFastPath to lookup the font for a given character.
78 PassRefPtr<SimpleFontData> fallbackFontForCharacter(const FontDescription&, UChar32, const SimpleFontData* fontDataToSubstitute); 79 PassRefPtr<SimpleFontData> fallbackFontForCharacter(const FontDescription&,
80 UChar32,
81 const SimpleFontData* fontDataToSubstitute,
82 FontFallbackPriority = FontFallbackPriority::Text);
79 83
80 // Also implemented by the platform. 84 // Also implemented by the platform.
81 void platformInit(); 85 void platformInit();
82 86
83 PassRefPtr<SimpleFontData> getFontData(const FontDescription&, const AtomicS tring&, bool checkingAlternateName = false, ShouldRetain = Retain); 87 PassRefPtr<SimpleFontData> getFontData(const FontDescription&, const AtomicS tring&, bool checkingAlternateName = false, ShouldRetain = Retain);
84 PassRefPtr<SimpleFontData> getLastResortFallbackFont(const FontDescription&, ShouldRetain = Retain); 88 PassRefPtr<SimpleFontData> getLastResortFallbackFont(const FontDescription&, ShouldRetain = Retain);
85 SimpleFontData* getNonRetainedLastResortFallbackFont(const FontDescription&) ; 89 SimpleFontData* getNonRetainedLastResortFallbackFont(const FontDescription&) ;
86 bool isPlatformFontAvailable(const FontDescription&, const AtomicString&); 90 bool isPlatformFontAvailable(const FontDescription&, const AtomicString&);
87 91
88 // Returns the ShapeCache instance associated with the given cache key. 92 // Returns the ShapeCache instance associated with the given cache key.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 USING_FAST_MALLOC(FontCachePurgePreventer); 203 USING_FAST_MALLOC(FontCachePurgePreventer);
200 WTF_MAKE_NONCOPYABLE(FontCachePurgePreventer); 204 WTF_MAKE_NONCOPYABLE(FontCachePurgePreventer);
201 public: 205 public:
202 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); } 206 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); }
203 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } 207 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); }
204 }; 208 };
205 209
206 } // namespace blink 210 } // namespace blink
207 211
208 #endif 212 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698