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

Side by Side Diff: trunk/src/ports/SkHarfBuzzFont.cpp

Issue 13001002: remove GetTable* APIs from SkFontHost, and rely on SkTypeface::onGetTable* (Closed) Base URL: http://skia.googlecode.com/svn/
Patch Set: Created 7 years, 9 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 | « trunk/src/ports/SkFontHost_tables.cpp ('k') | no next file » | 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 /* 2 /*
3 * Copyright 2009 The Android Open Source Project 3 * Copyright 2009 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkHarfBuzzFont.h" 10 #include "SkHarfBuzzFont.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 getFontMetric, 159 getFontMetric,
160 }; 160 };
161 161
162 const HB_FontClass& SkHarfBuzzFont::GetFontClass() { 162 const HB_FontClass& SkHarfBuzzFont::GetFontClass() {
163 return gSkHarfBuzzFontClass; 163 return gSkHarfBuzzFontClass;
164 } 164 }
165 165
166 HB_Error SkHarfBuzzFont::GetFontTableFunc(void* voidface, const HB_Tag tag, 166 HB_Error SkHarfBuzzFont::GetFontTableFunc(void* voidface, const HB_Tag tag,
167 HB_Byte* buffer, HB_UInt* len) { 167 HB_Byte* buffer, HB_UInt* len) {
168 SkHarfBuzzFont* font = reinterpret_cast<SkHarfBuzzFont*>(voidface); 168 SkHarfBuzzFont* font = reinterpret_cast<SkHarfBuzzFont*>(voidface);
169 uint32_t uniqueID = SkTypeface::UniqueID(font->getTypeface()); 169 SkTypeface* typeface = font->getTypeface();
170 170
171 const size_t tableSize = SkFontHost::GetTableSize(uniqueID, tag); 171 const size_t tableSize = typeface->getTableSize(tag);
172 if (!tableSize) { 172 if (!tableSize) {
173 return HB_Err_Invalid_Argument; 173 return HB_Err_Invalid_Argument;
174 } 174 }
175 // If Harfbuzz specified a NULL buffer then it's asking for the size. 175 // If Harfbuzz specified a NULL buffer then it's asking for the size.
176 if (!buffer) { 176 if (!buffer) {
177 *len = tableSize; 177 *len = tableSize;
178 return HB_Err_Ok; 178 return HB_Err_Ok;
179 } 179 }
180 180
181 if (*len < tableSize) { 181 if (*len < tableSize) {
182 // is this right, or should we just copy less than the full table? 182 // is this right, or should we just copy less than the full table?
183 return HB_Err_Invalid_Argument; 183 return HB_Err_Invalid_Argument;
184 } 184 }
185 SkFontHost::GetTableData(uniqueID, tag, 0, tableSize, buffer); 185 typeface->getTableData(tag, 0, tableSize, buffer);
186 return HB_Err_Ok; 186 return HB_Err_Ok;
187 } 187 }
188
OLDNEW
« no previous file with comments | « trunk/src/ports/SkFontHost_tables.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698