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

Side by Side Diff: Source/core/platform/graphics/FontCache.h

Issue 23480016: Switch non-gdi windows font path to use new SkFontMgr (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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
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 27 matching lines...) Expand all
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(WINDOWS)
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 class SkFontMgr;
48 class SkTypeface; 49 class SkTypeface;
49 50
50 namespace WebCore { 51 namespace WebCore {
51 52
52 class Font; 53 class Font;
53 class FontPlatformData; 54 class FontPlatformData;
54 class FontData; 55 class FontData;
55 class FontDescription; 56 class FontDescription;
56 class FontSelector; 57 class FontSelector;
57 class OpenTypeVerticalData; 58 class OpenTypeVerticalData;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 void purgeInactiveFontDataIfNeeded(); 125 void purgeInactiveFontDataIfNeeded();
125 126
126 // FIXME: This method should eventually be removed. 127 // FIXME: This method should eventually be removed.
127 FontPlatformData* getFontResourcePlatformData(const FontDescription&, const AtomicString& family, bool checkingAlternateName = false); 128 FontPlatformData* getFontResourcePlatformData(const FontDescription&, const AtomicString& family, bool checkingAlternateName = false);
128 129
129 // These methods are implemented by each platform. 130 // These methods are implemented by each platform.
130 PassRefPtr<SimpleFontData> getSimilarFontPlatformData(const Font&); 131 PassRefPtr<SimpleFontData> getSimilarFontPlatformData(const Font&);
131 FontPlatformData* createFontPlatformData(const FontDescription&, const Atomi cString& family); 132 FontPlatformData* createFontPlatformData(const FontDescription&, const Atomi cString& family);
132 133
133 // Implemented on skia platforms. 134 // Implemented on skia platforms.
134 SkTypeface* createTypeface(const FontDescription&, const AtomicString& famil y, CString& name); 135 void getFontNameIncludingFallback(const FontDescription&, const AtomicString &, CString& name);
135 136
136 PassRefPtr<SimpleFontData> getFontResourceData(const FontPlatformData*, Shou ldRetain = Retain); 137 PassRefPtr<SimpleFontData> getFontResourceData(const FontPlatformData*, Shou ldRetain = Retain);
137 const FontPlatformData* getFallbackFontData(const FontDescription&); 138 const FontPlatformData* getFallbackFontData(const FontDescription&);
138 139
139 // Don't purge if this count is > 0; 140 // Don't purge if this count is > 0;
140 int m_purgePreventCount; 141 int m_purgePreventCount;
141 142
143 #if OS(WINDOWS) && !ENABLE(GDI_FONTS_ON_WINDOWS)
144 SkFontMgr* m_fontManager;
bungeman-chromium 2013/08/31 02:57:24 SkFontMgr is SkRefCnt which is compatible with Ref
reed1 2013/09/03 17:38:46 Do we want to have 2 fontmgrs now (one for GDI, on
eae 2013/09/03 21:04:14 Great, I'll do that.
145 #endif
146
142 #if OS(DARWIN) || OS(ANDROID) 147 #if OS(DARWIN) || OS(ANDROID)
143 friend class ComplexTextController; 148 friend class ComplexTextController;
144 #endif 149 #endif
145 friend class SimpleFontData; // For getFontResourceData(const FontPlatformDa ta*) 150 friend class SimpleFontData; // For getFontResourceData(const FontPlatformDa ta*)
146 friend class FontFallbackList; 151 friend class FontFallbackList;
147 }; 152 };
148 153
149 // Get the global fontCache. 154 // Get the global fontCache.
150 FontCache* fontCache(); 155 FontCache* fontCache();
151 156
152 class FontCachePurgePreventer { 157 class FontCachePurgePreventer {
153 public: 158 public:
154 FontCachePurgePreventer() { fontCache()->disablePurging(); } 159 FontCachePurgePreventer() { fontCache()->disablePurging(); }
155 ~FontCachePurgePreventer() { fontCache()->enablePurging(); } 160 ~FontCachePurgePreventer() { fontCache()->enablePurging(); }
156 }; 161 };
157 162
158 } 163 }
159 164
160 #endif 165 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/platform/graphics/FontCache.cpp » ('j') | Source/core/platform/graphics/skia/FontCacheSkia.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698