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

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

Issue 1873923002: Begin switch to SkFontStyle for legacy calls. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Dont update bzl file now. Created 4 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
« no previous file with comments | « src/fonts/SkFontMgr_indirect.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" 11 #include "SkMutex.h"
12 12
13 #include <fontconfig/fontconfig.h> 13 #include <fontconfig/fontconfig.h>
14 14
15 class SkFontConfigInterfaceDirect : public SkFontConfigInterface { 15 class SkFontConfigInterfaceDirect : public SkFontConfigInterface {
16 public: 16 public:
17 SkFontConfigInterfaceDirect(); 17 SkFontConfigInterfaceDirect();
18 ~SkFontConfigInterfaceDirect() override; 18 ~SkFontConfigInterfaceDirect() override;
19 19
20 #ifdef SK_VERY_LEGACY_CREATE_TYPEFACE
20 bool matchFamilyName(const char familyName[], 21 bool matchFamilyName(const char familyName[],
21 SkTypeface::Style requested, 22 SkTypeface::Style requested,
22 FontIdentity* outFontIdentifier, 23 FontIdentity* outFontIdentifier,
23 SkString* outFamilyName, 24 SkString* outFamilyName,
24 SkTypeface::Style* outStyle) override; 25 SkTypeface::Style* outStyle) override;
26 #else
27 bool matchFamilyName(const char familyName[],
28 SkFontStyle requested,
29 FontIdentity* outFontIdentifier,
30 SkString* outFamilyName,
31 SkFontStyle* outStyle) override;
32
33 #endif
25 SkStreamAsset* openStream(const FontIdentity&) override; 34 SkStreamAsset* openStream(const FontIdentity&) override;
26 35
27 // new APIs 36 // new APIs
28 SkDataTable* getFamilyNames() override; 37 SkDataTable* getFamilyNames() override;
29 38
30 protected: 39 protected:
31 virtual bool isAccessible(const char* filename); 40 virtual bool isAccessible(const char* filename);
32 41
33 private: 42 private:
34 SkMutex mutex_; 43 SkMutex mutex_;
35 44
36 bool isValidPattern(FcPattern* pattern); 45 bool isValidPattern(FcPattern* pattern);
37 FcPattern* MatchFont(FcFontSet* font_set, const char* post_config_family, 46 FcPattern* MatchFont(FcFontSet* font_set, const char* post_config_family,
38 const SkString& family); 47 const SkString& family);
39 typedef SkFontConfigInterface INHERITED; 48 typedef SkFontConfigInterface INHERITED;
40 }; 49 };
OLDNEW
« no previous file with comments | « src/fonts/SkFontMgr_indirect.cpp ('k') | src/ports/SkFontConfigInterface_direct.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698