OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009 Google Inc. | 2 * Copyright 2009 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 <unistd.h> | 10 #include <unistd.h> |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 class SkFontConfigInterfaceDirect : public SkFontConfigInterface { | 105 class SkFontConfigInterfaceDirect : public SkFontConfigInterface { |
106 public: | 106 public: |
107 SkFontConfigInterfaceDirect(); | 107 SkFontConfigInterfaceDirect(); |
108 virtual ~SkFontConfigInterfaceDirect(); | 108 virtual ~SkFontConfigInterfaceDirect(); |
109 | 109 |
110 virtual bool matchFamilyName(const char familyName[], | 110 virtual bool matchFamilyName(const char familyName[], |
111 SkTypeface::Style requested, | 111 SkTypeface::Style requested, |
112 FontIdentity* outFontIdentifier, | 112 FontIdentity* outFontIdentifier, |
113 SkString* outFamilyName, | 113 SkString* outFamilyName, |
114 SkTypeface::Style* outStyle) SK_OVERRIDE; | 114 SkTypeface::Style* outStyle) SK_OVERRIDE; |
115 SkStream* openStream(const FontIdentity&) SK_OVERRIDE; | 115 SkStreamAsset* openStream(const FontIdentity&) SK_OVERRIDE; |
116 | 116 |
117 // new APIs | 117 // new APIs |
118 SkDataTable* getFamilyNames() SK_OVERRIDE; | 118 SkDataTable* getFamilyNames() SK_OVERRIDE; |
119 virtual bool matchFamilySet(const char inFamilyName[], | 119 virtual bool matchFamilySet(const char inFamilyName[], |
120 SkString* outFamilyName, | 120 SkString* outFamilyName, |
121 SkTArray<FontIdentity>*) SK_OVERRIDE; | 121 SkTArray<FontIdentity>*) SK_OVERRIDE; |
122 | 122 |
123 private: | 123 private: |
124 SkMutex mutex_; | 124 SkMutex mutex_; |
125 }; | 125 }; |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 } | 545 } |
546 if (outFamilyName) { | 546 if (outFamilyName) { |
547 outFamilyName->set(post_config_family); | 547 outFamilyName->set(post_config_family); |
548 } | 548 } |
549 if (outStyle) { | 549 if (outStyle) { |
550 *outStyle = GetFontStyle(match); | 550 *outStyle = GetFontStyle(match); |
551 } | 551 } |
552 return true; | 552 return true; |
553 } | 553 } |
554 | 554 |
555 SkStream* SkFontConfigInterfaceDirect::openStream(const FontIdentity& identity)
{ | 555 SkStreamAsset* SkFontConfigInterfaceDirect::openStream(const FontIdentity& ident
ity) { |
556 return SkStream::NewFromFile(identity.fString.c_str()); | 556 return SkStream::NewFromFile(identity.fString.c_str()); |
557 } | 557 } |
558 | 558 |
559 /////////////////////////////////////////////////////////////////////////////// | 559 /////////////////////////////////////////////////////////////////////////////// |
560 | 560 |
561 static bool find_name(const SkTDArray<const char*>& list, const char* str) { | 561 static bool find_name(const SkTDArray<const char*>& list, const char* str) { |
562 int count = list.count(); | 562 int count = list.count(); |
563 for (int i = 0; i < count; ++i) { | 563 for (int i = 0; i < count; ++i) { |
564 if (!strcmp(list[i], str)) { | 564 if (!strcmp(list[i], str)) { |
565 return true; | 565 return true; |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 *trimmedMatches.append() = match[i]; | 726 *trimmedMatches.append() = match[i]; |
727 } | 727 } |
728 } | 728 } |
729 | 729 |
730 SkFontStyleSet_FC* sset = SkNEW_ARGS(SkFontStyleSet_FC, | 730 SkFontStyleSet_FC* sset = SkNEW_ARGS(SkFontStyleSet_FC, |
731 (trimmedMatches.begin(), | 731 (trimmedMatches.begin(), |
732 trimmedMatches.count())); | 732 trimmedMatches.count())); |
733 #endif | 733 #endif |
734 return false; | 734 return false; |
735 } | 735 } |
OLD | NEW |