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

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

Issue 553163002: [DirectWrite] Limit noSubpixelForSmallSizeFont to low-DPI (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 void invalidate(); 97 void invalidate();
98 98
99 #if OS(WIN) 99 #if OS(WIN)
100 PassRefPtr<SimpleFontData> fontDataFromDescriptionAndLogFont(const FontDescr iption&, ShouldRetain, const LOGFONT&, wchar_t* outFontFamilyName); 100 PassRefPtr<SimpleFontData> fontDataFromDescriptionAndLogFont(const FontDescr iption&, ShouldRetain, const LOGFONT&, wchar_t* outFontFamilyName);
101 #endif 101 #endif
102 102
103 #if OS(WIN) 103 #if OS(WIN)
104 bool useSubpixelPositioning() const { return s_useSubpixelPositioning; } 104 bool useSubpixelPositioning() const { return s_useSubpixelPositioning; }
105 SkFontMgr* fontManager() { return m_fontManager.get(); } 105 SkFontMgr* fontManager() { return m_fontManager.get(); }
106 static bool useDirectWrite() { return s_useDirectWrite; } 106 static bool useDirectWrite() { return s_useDirectWrite; }
107 static float deviceScaleFactor() { return s_deviceScaleFactor; }
107 static void setUseDirectWrite(bool useDirectWrite) { s_useDirectWrite = useD irectWrite; } 108 static void setUseDirectWrite(bool useDirectWrite) { s_useDirectWrite = useD irectWrite; }
108 static void setDirectWriteFactory(IDWriteFactory* factory) { s_directWriteFa ctory = factory; } 109 static void setDirectWriteFactory(IDWriteFactory* factory) { s_directWriteFa ctory = factory; }
110 static void setDeviceScaleFactor(float deviceScaleFactor) { s_deviceScaleFac tor = deviceScaleFactor; }
109 static void setUseSubpixelPositioning(bool useSubpixelPositioning) { s_useSu bpixelPositioning = useSubpixelPositioning; } 111 static void setUseSubpixelPositioning(bool useSubpixelPositioning) { s_useSu bpixelPositioning = useSubpixelPositioning; }
110 static void addSideloadedFontForTesting(SkTypeface*); 112 static void addSideloadedFontForTesting(SkTypeface*);
111 #endif 113 #endif
112 114
113 #if ENABLE(OPENTYPE_VERTICAL) 115 #if ENABLE(OPENTYPE_VERTICAL)
114 typedef uint32_t FontFileKey; 116 typedef uint32_t FontFileKey;
115 PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const F ontPlatformData&); 117 PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const F ontPlatformData&);
116 #endif 118 #endif
117 119
118 #if OS(ANDROID) 120 #if OS(ANDROID)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 PassRefPtr<SimpleFontData> fontDataFromFontPlatformData(const FontPlatformDa ta*, ShouldRetain = Retain); 157 PassRefPtr<SimpleFontData> fontDataFromFontPlatformData(const FontPlatformDa ta*, ShouldRetain = Retain);
156 PassRefPtr<SimpleFontData> fallbackOnStandardFontStyle(const FontDescription &, UChar32); 158 PassRefPtr<SimpleFontData> fallbackOnStandardFontStyle(const FontDescription &, UChar32);
157 159
158 // Don't purge if this count is > 0; 160 // Don't purge if this count is > 0;
159 int m_purgePreventCount; 161 int m_purgePreventCount;
160 162
161 #if OS(WIN) 163 #if OS(WIN)
162 OwnPtr<SkFontMgr> m_fontManager; 164 OwnPtr<SkFontMgr> m_fontManager;
163 static bool s_useDirectWrite; 165 static bool s_useDirectWrite;
164 static IDWriteFactory* s_directWriteFactory; 166 static IDWriteFactory* s_directWriteFactory;
167 static float s_deviceScaleFactor;
165 static bool s_useSubpixelPositioning; 168 static bool s_useSubpixelPositioning;
166 static HashMap<String, RefPtr<SkTypeface> >* s_sideloadedFonts; 169 static HashMap<String, RefPtr<SkTypeface> >* s_sideloadedFonts;
167 #endif 170 #endif
168 171
169 #if OS(MACOSX) || OS(ANDROID) 172 #if OS(MACOSX) || OS(ANDROID)
170 friend class ComplexTextController; 173 friend class ComplexTextController;
171 #endif 174 #endif
172 friend class SimpleFontData; // For fontDataFromFontPlatformData 175 friend class SimpleFontData; // For fontDataFromFontPlatformData
173 friend class FontFallbackList; 176 friend class FontFallbackList;
174 }; 177 };
175 178
176 class PLATFORM_EXPORT FontCachePurgePreventer { 179 class PLATFORM_EXPORT FontCachePurgePreventer {
177 public: 180 public:
178 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); } 181 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); }
179 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } 182 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); }
180 }; 183 };
181 184
182 } // namespace blink 185 } // namespace blink
183 186
184 #endif 187 #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