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

Side by Side Diff: trunk/include/ports/SkFontConfigInterface.h

Issue 14305007: check-point for linux fontmgr impl (Closed) Base URL: http://skia.googlecode.com/svn/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | trunk/include/ports/SkFontStyle.h » ('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 #ifndef SkFontConfigInterface_DEFINED 8 #ifndef SkFontConfigInterface_DEFINED
9 #define SkFontConfigInterface_DEFINED 9 #define SkFontConfigInterface_DEFINED
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 * to be a union of possible storage types to aid the impl. 42 * to be a union of possible storage types to aid the impl.
43 */ 43 */
44 struct FontIdentity { 44 struct FontIdentity {
45 FontIdentity() : fID(0), fTTCIndex(0) {} 45 FontIdentity() : fID(0), fTTCIndex(0) {}
46 46
47 bool operator==(const FontIdentity& other) const { 47 bool operator==(const FontIdentity& other) const {
48 return fID == other.fID && 48 return fID == other.fID &&
49 fTTCIndex == other.fTTCIndex && 49 fTTCIndex == other.fTTCIndex &&
50 fString == other.fString; 50 fString == other.fString;
51 } 51 }
52 bool operator!=(const FontIdentity& other) const {
53 return !(*this == other);
54 }
52 55
53 uint32_t fID; 56 uint32_t fID;
54 int32_t fTTCIndex; 57 int32_t fTTCIndex;
55 SkString fString; 58 SkString fString;
56 SkFontStyle fStyle; 59 SkFontStyle fStyle;
60
61 // If buffer is NULL, just return the number of bytes that would have
62 // been written. Will pad contents to a multiple of 4.
63 size_t writeToMemory(void* buffer = NULL) const;
64
65 // Recreate from a flattened buffer, returning the number of bytes read.
66 size_t readFromMemory(const void* buffer, size_t length);
57 }; 67 };
58 68
59 /** 69 /**
60 * Given a familyName and style, find the best match. 70 * Given a familyName and style, find the best match.
61 * 71 *
62 * If a match is found, return true and set its outFontIdentifier. 72 * If a match is found, return true and set its outFontIdentifier.
63 * If outFamilyName is not null, assign the found familyName to it 73 * If outFamilyName is not null, assign the found familyName to it
64 * (which may differ from the requested familyName). 74 * (which may differ from the requested familyName).
65 * If outStyle is not null, assign the found style to it 75 * If outStyle is not null, assign the found style to it
66 * (which may differ from the requested style). 76 * (which may differ from the requested style).
(...skipping 23 matching lines...) Expand all
90 100
91 virtual SkDataTable* getFamilyNames() { return SkDataTable::NewEmpty(); } 101 virtual SkDataTable* getFamilyNames() { return SkDataTable::NewEmpty(); }
92 virtual bool matchFamilySet(const char inFamilyName[], 102 virtual bool matchFamilySet(const char inFamilyName[],
93 SkString* outFamilyName, 103 SkString* outFamilyName,
94 SkTArray<FontIdentity>*) { 104 SkTArray<FontIdentity>*) {
95 return false; 105 return false;
96 } 106 }
97 }; 107 };
98 108
99 #endif 109 #endif
OLDNEW
« no previous file with comments | « no previous file | trunk/include/ports/SkFontStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698