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

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

Issue 210243004: Usage of DirectWrite now determined browser-side (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: include Created 6 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
« no previous file with comments | « no previous file | 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 void removeClient(FontCacheClient*); 86 void removeClient(FontCacheClient*);
87 87
88 unsigned short generation(); 88 unsigned short generation();
89 void invalidate(); 89 void invalidate();
90 90
91 #if OS(WIN) 91 #if OS(WIN)
92 PassRefPtr<SimpleFontData> fontDataFromDescriptionAndLogFont(const FontDescr iption&, ShouldRetain, const LOGFONT&, wchar_t* outFontFamilyName); 92 PassRefPtr<SimpleFontData> fontDataFromDescriptionAndLogFont(const FontDescr iption&, ShouldRetain, const LOGFONT&, wchar_t* outFontFamilyName);
93 #endif 93 #endif
94 94
95 #if OS(WIN) 95 #if OS(WIN)
96 bool useSubpixelPositioning() const { return m_useSubpixelPositioning; } 96 bool useSubpixelPositioning() const { return s_useSubpixelPositioning; }
97 SkFontMgr* fontManager() { return m_fontManager.get(); } 97 SkFontMgr* fontManager() { return m_fontManager.get(); }
98 static void setUseDirectWrite(bool useDirectWrite) { s_useDirectWrite = useD irectWrite; }
99 static void setUseSubpixelPositioning(bool useSubpixelPositioning) { s_useSu bpixelPositioning = useSubpixelPositioning; }
98 #endif 100 #endif
99 101
100 #if ENABLE(OPENTYPE_VERTICAL) 102 #if ENABLE(OPENTYPE_VERTICAL)
101 typedef uint32_t FontFileKey; 103 typedef uint32_t FontFileKey;
102 PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const F ontPlatformData&); 104 PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const F ontPlatformData&);
103 #endif 105 #endif
104 106
105 #if OS(ANDROID) 107 #if OS(ANDROID)
106 static AtomicString getGenericFamilyNameForScript(const AtomicString& family Name, UScriptCode); 108 static AtomicString getGenericFamilyNameForScript(const AtomicString& family Name, UScriptCode);
107 #else 109 #else
(...skipping 28 matching lines...) Expand all
136 // Implemented on skia platforms. 138 // Implemented on skia platforms.
137 PassRefPtr<SkTypeface> createTypeface(const FontDescription&, const AtomicSt ring& family, CString& name); 139 PassRefPtr<SkTypeface> createTypeface(const FontDescription&, const AtomicSt ring& family, CString& name);
138 140
139 PassRefPtr<SimpleFontData> fontDataFromFontPlatformData(const FontPlatformDa ta*, ShouldRetain = Retain); 141 PassRefPtr<SimpleFontData> fontDataFromFontPlatformData(const FontPlatformDa ta*, ShouldRetain = Retain);
140 142
141 // Don't purge if this count is > 0; 143 // Don't purge if this count is > 0;
142 int m_purgePreventCount; 144 int m_purgePreventCount;
143 145
144 #if OS(WIN) 146 #if OS(WIN)
145 OwnPtr<SkFontMgr> m_fontManager; 147 OwnPtr<SkFontMgr> m_fontManager;
146 bool m_useSubpixelPositioning; 148 static bool s_useDirectWrite;
149 static bool s_useSubpixelPositioning;
147 #endif 150 #endif
148 151
149 #if OS(MACOSX) || OS(ANDROID) 152 #if OS(MACOSX) || OS(ANDROID)
150 friend class ComplexTextController; 153 friend class ComplexTextController;
151 #endif 154 #endif
152 friend class SimpleFontData; // For fontDataFromFontPlatformData 155 friend class SimpleFontData; // For fontDataFromFontPlatformData
153 friend class FontFallbackList; 156 friend class FontFallbackList;
154 }; 157 };
155 158
156 class PLATFORM_EXPORT FontCachePurgePreventer { 159 class PLATFORM_EXPORT FontCachePurgePreventer {
157 public: 160 public:
158 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); } 161 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); }
159 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } 162 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); }
160 }; 163 };
161 164
162 } 165 }
163 166
164 #endif 167 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/platform/fonts/FontCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698