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

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

Issue 213223003: Add ability to pass through IDWriteFactory so sandbox can control how it's constructed (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« 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 27 matching lines...) Expand all
38 #include "wtf/Vector.h" 38 #include "wtf/Vector.h"
39 #include "wtf/text/CString.h" 39 #include "wtf/text/CString.h"
40 #include "wtf/text/WTFString.h" 40 #include "wtf/text/WTFString.h"
41 #include "wtf/unicode/Unicode.h" 41 #include "wtf/unicode/Unicode.h"
42 42
43 #if OS(WIN) 43 #if OS(WIN)
44 #include "SkFontMgr.h" 44 #include "SkFontMgr.h"
45 #include <windows.h> 45 #include <windows.h>
46 #include <objidl.h> 46 #include <objidl.h>
47 #include <mlang.h> 47 #include <mlang.h>
48 struct IDWriteFactory;
48 #endif 49 #endif
49 50
50 #if OS(ANDROID) 51 #if OS(ANDROID)
51 #include <unicode/uscript.h> 52 #include <unicode/uscript.h>
52 #endif 53 #endif
53 54
54 class SkTypeface; 55 class SkTypeface;
55 56
56 namespace WebCore { 57 namespace WebCore {
57 58
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 void invalidate(); 94 void invalidate();
94 95
95 #if OS(WIN) 96 #if OS(WIN)
96 PassRefPtr<SimpleFontData> fontDataFromDescriptionAndLogFont(const FontDescr iption&, ShouldRetain, const LOGFONT&, wchar_t* outFontFamilyName); 97 PassRefPtr<SimpleFontData> fontDataFromDescriptionAndLogFont(const FontDescr iption&, ShouldRetain, const LOGFONT&, wchar_t* outFontFamilyName);
97 #endif 98 #endif
98 99
99 #if OS(WIN) 100 #if OS(WIN)
100 bool useSubpixelPositioning() const { return s_useSubpixelPositioning; } 101 bool useSubpixelPositioning() const { return s_useSubpixelPositioning; }
101 SkFontMgr* fontManager() { return m_fontManager.get(); } 102 SkFontMgr* fontManager() { return m_fontManager.get(); }
102 static void setUseDirectWrite(bool useDirectWrite) { s_useDirectWrite = useD irectWrite; } 103 static void setUseDirectWrite(bool useDirectWrite) { s_useDirectWrite = useD irectWrite; }
104 static void setDirectWriteFactory(IDWriteFactory* factory) { s_directWriteFa ctory = factory; }
103 static void setUseSubpixelPositioning(bool useSubpixelPositioning) { s_useSu bpixelPositioning = useSubpixelPositioning; } 105 static void setUseSubpixelPositioning(bool useSubpixelPositioning) { s_useSu bpixelPositioning = useSubpixelPositioning; }
104 #endif 106 #endif
105 107
106 #if ENABLE(OPENTYPE_VERTICAL) 108 #if ENABLE(OPENTYPE_VERTICAL)
107 typedef uint32_t FontFileKey; 109 typedef uint32_t FontFileKey;
108 PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const F ontPlatformData&); 110 PassRefPtr<OpenTypeVerticalData> getVerticalData(const FontFileKey&, const F ontPlatformData&);
109 #endif 111 #endif
110 112
111 #if OS(ANDROID) 113 #if OS(ANDROID)
112 static AtomicString getGenericFamilyNameForScript(const AtomicString& family Name, UScriptCode); 114 static AtomicString getGenericFamilyNameForScript(const AtomicString& family Name, UScriptCode);
(...skipping 30 matching lines...) Expand all
143 PassRefPtr<SkTypeface> createTypeface(const FontDescription&, const AtomicSt ring& family, CString& name); 145 PassRefPtr<SkTypeface> createTypeface(const FontDescription&, const AtomicSt ring& family, CString& name);
144 146
145 PassRefPtr<SimpleFontData> fontDataFromFontPlatformData(const FontPlatformDa ta*, ShouldRetain = Retain); 147 PassRefPtr<SimpleFontData> fontDataFromFontPlatformData(const FontPlatformDa ta*, ShouldRetain = Retain);
146 148
147 // Don't purge if this count is > 0; 149 // Don't purge if this count is > 0;
148 int m_purgePreventCount; 150 int m_purgePreventCount;
149 151
150 #if OS(WIN) 152 #if OS(WIN)
151 OwnPtr<SkFontMgr> m_fontManager; 153 OwnPtr<SkFontMgr> m_fontManager;
152 static bool s_useDirectWrite; 154 static bool s_useDirectWrite;
155 static IDWriteFactory* s_directWriteFactory;
153 static bool s_useSubpixelPositioning; 156 static bool s_useSubpixelPositioning;
154 #endif 157 #endif
155 158
156 #if OS(MACOSX) || OS(ANDROID) 159 #if OS(MACOSX) || OS(ANDROID)
157 friend class ComplexTextController; 160 friend class ComplexTextController;
158 #endif 161 #endif
159 friend class SimpleFontData; // For fontDataFromFontPlatformData 162 friend class SimpleFontData; // For fontDataFromFontPlatformData
160 friend class FontFallbackList; 163 friend class FontFallbackList;
161 }; 164 };
162 165
163 class PLATFORM_EXPORT FontCachePurgePreventer { 166 class PLATFORM_EXPORT FontCachePurgePreventer {
164 public: 167 public:
165 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); } 168 FontCachePurgePreventer() { FontCache::fontCache()->disablePurging(); }
166 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); } 169 ~FontCachePurgePreventer() { FontCache::fontCache()->enablePurging(); }
167 }; 170 };
168 171
169 } 172 }
170 173
171 #endif 174 #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