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

Side by Side Diff: src/core/SkFontDescriptor.h

Issue 2067583002: Revert of Update typeface serialization style. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 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 | « include/core/SkPicture.h ('k') | src/core/SkFontDescriptor.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 2012 Google Inc. 2 * Copyright 2012 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 #ifndef SkFontDescriptor_DEFINED 8 #ifndef SkFontDescriptor_DEFINED
9 #define SkFontDescriptor_DEFINED 9 #define SkFontDescriptor_DEFINED
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 private: 44 private:
45 SkAutoTDelete<SkStreamAsset> fStream; 45 SkAutoTDelete<SkStreamAsset> fStream;
46 int fIndex; 46 int fIndex;
47 int fAxisCount; 47 int fAxisCount;
48 SkAutoSTMalloc<4, SkFixed> fAxis; 48 SkAutoSTMalloc<4, SkFixed> fAxis;
49 }; 49 };
50 50
51 class SkFontDescriptor : SkNoncopyable { 51 class SkFontDescriptor : SkNoncopyable {
52 public: 52 public:
53 SkFontDescriptor(); 53 SkFontDescriptor(SkTypeface::Style = SkTypeface::kNormal);
54 // Does not affect ownership of SkStream. 54 // Does not affect ownership of SkStream.
55 static bool Deserialize(SkStream*, SkFontDescriptor* result); 55 static bool Deserialize(SkStream*, SkFontDescriptor* result);
56 56
57 void serialize(SkWStream*); 57 void serialize(SkWStream*);
58 58
59 SkFontStyle getStyle() { return fStyle; } 59 SkTypeface::Style getStyle() { return fStyle; }
60 void setStyle(SkFontStyle style) { fStyle = style; } 60 void setStyle(SkTypeface::Style style) { fStyle = style; }
61 61
62 const char* getFamilyName() const { return fFamilyName.c_str(); } 62 const char* getFamilyName() const { return fFamilyName.c_str(); }
63 const char* getFullName() const { return fFullName.c_str(); } 63 const char* getFullName() const { return fFullName.c_str(); }
64 const char* getPostscriptName() const { return fPostscriptName.c_str(); } 64 const char* getPostscriptName() const { return fPostscriptName.c_str(); }
65 bool hasFontData() const { return fFontData.get() != nullptr; } 65 bool hasFontData() const { return fFontData.get() != nullptr; }
66 SkFontData* detachFontData() { return fFontData.release(); } 66 SkFontData* detachFontData() { return fFontData.release(); }
67 67
68 void setFamilyName(const char* name) { fFamilyName.set(name); } 68 void setFamilyName(const char* name) { fFamilyName.set(name); }
69 void setFullName(const char* name) { fFullName.set(name); } 69 void setFullName(const char* name) { fFullName.set(name); }
70 void setPostscriptName(const char* name) { fPostscriptName.set(name); } 70 void setPostscriptName(const char* name) { fPostscriptName.set(name); }
71 /** Set the font data only if it is necessary for serialization. 71 /** Set the font data only if it is necessary for serialization.
72 * This method takes ownership of the font data. */ 72 * This method takes ownership of the font data. */
73 void setFontData(SkFontData* data) { fFontData.reset(data); } 73 void setFontData(SkFontData* data) { fFontData.reset(data); }
74 74
75 private: 75 private:
76 SkString fFamilyName; 76 SkString fFamilyName;
77 SkString fFullName; 77 SkString fFullName;
78 SkString fPostscriptName; 78 SkString fPostscriptName;
79 SkAutoTDelete<SkFontData> fFontData; 79 SkAutoTDelete<SkFontData> fFontData;
80 80
81 SkFontStyle fStyle; 81 SkTypeface::Style fStyle;
82 }; 82 };
83 83
84 #endif // SkFontDescriptor_DEFINED 84 #endif // SkFontDescriptor_DEFINED
OLDNEW
« no previous file with comments | « include/core/SkPicture.h ('k') | src/core/SkFontDescriptor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698