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

Side by Side Diff: src/ports/SkFontConfigInterface_direct.h

Issue 1936213002: Clean up SkFontConfigInterface implementation. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkOnce Created 4 years, 7 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 | « src/fonts/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkFontConfigInterface_direct.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 2009-2015 Google Inc. 2 * Copyright 2009-2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ 8 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */
9 9
10 #include "SkFontConfigInterface.h" 10 #include "SkFontConfigInterface.h"
11 #include "SkMutex.h"
12 11
13 #include <fontconfig/fontconfig.h> 12 #include <fontconfig/fontconfig.h>
14 13
15 class SkFontConfigInterfaceDirect : public SkFontConfigInterface { 14 class SkFontConfigInterfaceDirect : public SkFontConfigInterface {
16 public: 15 public:
17 SkFontConfigInterfaceDirect(); 16 SkFontConfigInterfaceDirect();
18 ~SkFontConfigInterfaceDirect() override; 17 ~SkFontConfigInterfaceDirect() override;
19 18
20 bool matchFamilyName(const char familyName[], 19 bool matchFamilyName(const char familyName[],
21 SkFontStyle requested, 20 SkFontStyle requested,
22 FontIdentity* outFontIdentifier, 21 FontIdentity* outFontIdentifier,
23 SkString* outFamilyName, 22 SkString* outFamilyName,
24 SkFontStyle* outStyle) override; 23 SkFontStyle* outStyle) override;
25 24
26 SkStreamAsset* openStream(const FontIdentity&) override; 25 SkStreamAsset* openStream(const FontIdentity&) override;
27 26
28 // new APIs 27 // new APIs
29 SkDataTable* getFamilyNames() override; 28 SkDataTable* getFamilyNames() override;
30 29
31 protected: 30 protected:
32 virtual bool isAccessible(const char* filename); 31 virtual bool isAccessible(const char* filename);
33 32
34 private: 33 private:
35 SkMutex mutex_;
36
37 bool isValidPattern(FcPattern* pattern); 34 bool isValidPattern(FcPattern* pattern);
38 FcPattern* MatchFont(FcFontSet* font_set, const char* post_config_family, 35 FcPattern* MatchFont(FcFontSet* font_set, const char* post_config_family,
39 const SkString& family); 36 const SkString& family);
40 typedef SkFontConfigInterface INHERITED; 37 typedef SkFontConfigInterface INHERITED;
41 }; 38 };
OLDNEW
« no previous file with comments | « src/fonts/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkFontConfigInterface_direct.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698