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

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

Issue 21353004: Use Skia for font selection on windows (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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 26 matching lines...) Expand all
37 #include "wtf/Vector.h" 37 #include "wtf/Vector.h"
38 #include "wtf/text/WTFString.h" 38 #include "wtf/text/WTFString.h"
39 #include "wtf/unicode/Unicode.h" 39 #include "wtf/unicode/Unicode.h"
40 40
41 #if OS(WINDOWS) 41 #if OS(WINDOWS)
42 #include <windows.h> 42 #include <windows.h>
43 #include <objidl.h> 43 #include <objidl.h>
44 #include <mlang.h> 44 #include <mlang.h>
45 #endif 45 #endif
46 46
47 class SkTypeface;
48
47 namespace WebCore { 49 namespace WebCore {
48 50
49 class Font; 51 class Font;
50 class FontPlatformData; 52 class FontPlatformData;
51 class FontData; 53 class FontData;
52 class FontDescription; 54 class FontDescription;
53 class FontSelector; 55 class FontSelector;
54 class OpenTypeVerticalData; 56 class OpenTypeVerticalData;
55 class SimpleFontData; 57 class SimpleFontData;
56 58
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 121
120 void purgeInactiveFontDataIfNeeded(); 122 void purgeInactiveFontDataIfNeeded();
121 123
122 // FIXME: This method should eventually be removed. 124 // FIXME: This method should eventually be removed.
123 FontPlatformData* getFontResourcePlatformData(const FontDescription&, const AtomicString& family, bool checkingAlternateName = false); 125 FontPlatformData* getFontResourcePlatformData(const FontDescription&, const AtomicString& family, bool checkingAlternateName = false);
124 126
125 // These methods are implemented by each platform. 127 // These methods are implemented by each platform.
126 PassRefPtr<SimpleFontData> getSimilarFontPlatformData(const Font&); 128 PassRefPtr<SimpleFontData> getSimilarFontPlatformData(const Font&);
127 FontPlatformData* createFontPlatformData(const FontDescription&, const Atomi cString& family); 129 FontPlatformData* createFontPlatformData(const FontDescription&, const Atomi cString& family);
128 130
131 // Implemented on skia platforms.
132 SkTypeface* createTypeface(const FontDescription&, const AtomicString& famil y);
133
129 PassRefPtr<SimpleFontData> getFontResourceData(const FontPlatformData*, Shou ldRetain = Retain); 134 PassRefPtr<SimpleFontData> getFontResourceData(const FontPlatformData*, Shou ldRetain = Retain);
130 const FontPlatformData* getFallbackFontData(const FontDescription&); 135 const FontPlatformData* getFallbackFontData(const FontDescription&);
131 136
132 // Don't purge if this count is > 0; 137 // Don't purge if this count is > 0;
133 int m_purgePreventCount; 138 int m_purgePreventCount;
134 139
135 #if OS(DARWIN) || OS(ANDROID) 140 #if OS(DARWIN) || OS(ANDROID)
136 friend class ComplexTextController; 141 friend class ComplexTextController;
137 #endif 142 #endif
138 friend class SimpleFontData; // For getFontResourceData(const FontPlatformDa ta*) 143 friend class SimpleFontData; // For getFontResourceData(const FontPlatformDa ta*)
139 friend class FontFallbackList; 144 friend class FontFallbackList;
140 }; 145 };
141 146
142 // Get the global fontCache. 147 // Get the global fontCache.
143 FontCache* fontCache(); 148 FontCache* fontCache();
144 149
145 class FontCachePurgePreventer { 150 class FontCachePurgePreventer {
146 public: 151 public:
147 FontCachePurgePreventer() { fontCache()->disablePurging(); } 152 FontCachePurgePreventer() { fontCache()->disablePurging(); }
148 ~FontCachePurgePreventer() { fontCache()->enablePurging(); } 153 ~FontCachePurgePreventer() { fontCache()->enablePurging(); }
149 }; 154 };
150 155
151 } 156 }
152 157
153 #endif 158 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698