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

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

Issue 936893002: Clarify desired behavior of FontConfigTypeface::LegacyCreateTypeface. (Closed) Base URL: https://skia.googlesource.com/skia.git@typefacecache
Patch Set: Line wrapping. Created 5 years, 10 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/SkFontHost_fontconfig.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 2013 Google Inc. 2 * Copyright 2013 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 #include "SkFontConfigInterface.h" 8 #include "SkFontConfigInterface.h"
9 #include "SkFontHost_FreeType_common.h" 9 #include "SkFontHost_FreeType_common.h"
10 #include "SkStream.h" 10 #include "SkStream.h"
(...skipping 21 matching lines...) Expand all
32 const SkFontConfigInterface::FontIdentity& getIdentity() const { 32 const SkFontConfigInterface::FontIdentity& getIdentity() const {
33 return fIdentity; 33 return fIdentity;
34 } 34 }
35 35
36 SkStreamAsset* getLocalStream() const { return fLocalStream.get(); } 36 SkStreamAsset* getLocalStream() const { return fLocalStream.get(); }
37 37
38 bool isFamilyName(const char* name) const { 38 bool isFamilyName(const char* name) const {
39 return fFamilyName.equals(name); 39 return fFamilyName.equals(name);
40 } 40 }
41 41
42 static SkTypeface* LegacyCreateTypeface(const SkTypeface* family, 42 static SkTypeface* LegacyCreateTypeface(const char familyName[], SkTypeface: :Style);
43 const char familyName[],
44 SkTypeface::Style);
45 43
46 protected: 44 protected:
47 friend class SkFontHost; // hack until we can make public versions 45 friend class SkFontHost; // hack until we can make public versions
48 46
49 FontConfigTypeface(const SkFontStyle& style, 47 FontConfigTypeface(const SkFontStyle& style,
50 const SkFontConfigInterface::FontIdentity& fi, 48 const SkFontConfigInterface::FontIdentity& fi,
51 const SkString& familyName) 49 const SkString& familyName)
52 : INHERITED(style, SkTypefaceCache::NewFontID(), false) 50 : INHERITED(style, SkTypefaceCache::NewFontID(), false)
53 , fIdentity(fi) 51 , fIdentity(fi)
54 , fFamilyName(familyName) 52 , fFamilyName(familyName)
55 , fLocalStream(NULL) {} 53 , fLocalStream(NULL) {}
56 54
57 FontConfigTypeface(const SkFontStyle& style, bool fixedWidth, SkStreamAsset* localStream) 55 FontConfigTypeface(const SkFontStyle& style, bool fixedWidth, SkStreamAsset* localStream)
58 : INHERITED(style, SkTypefaceCache::NewFontID(), fixedWidth) 56 : INHERITED(style, SkTypefaceCache::NewFontID(), fixedWidth)
59 , fLocalStream(localStream) { 57 , fLocalStream(localStream) {
60 // we default to empty fFamilyName and fIdentity 58 // we default to empty fFamilyName and fIdentity
61 } 59 }
62 60
63 void onGetFamilyName(SkString* familyName) const SK_OVERRIDE; 61 void onGetFamilyName(SkString* familyName) const SK_OVERRIDE;
64 void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE; 62 void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE;
65 SkStreamAsset* onOpenStream(int* ttcIndex) const SK_OVERRIDE; 63 SkStreamAsset* onOpenStream(int* ttcIndex) const SK_OVERRIDE;
66 64
67 private: 65 private:
68 typedef SkTypeface_FreeType INHERITED; 66 typedef SkTypeface_FreeType INHERITED;
69 }; 67 };
OLDNEW
« no previous file with comments | « src/fonts/SkFontMgr_fontconfig.cpp ('k') | src/ports/SkFontHost_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698