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

Side by Side Diff: trunk/src/ports/SkFontHost_tables.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_mac.cpp ('k') | trunk/src/ports/SkHarfBuzzFont.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkEndian.h"
9 #include "SkFontHost.h"
10 #include "SkFontStream.h"
11 #include "SkStream.h"
12
13 int SkFontHost::CountTables(SkFontID fontID) {
14 SkStream* stream = SkFontHost::OpenStream(fontID);
15 if (NULL == stream) {
16 return 0;
17 }
18
19 SkAutoUnref au(stream);
20 int ttcIndex = 0;
21 return SkFontStream::GetTableTags(stream, ttcIndex, NULL);
22 }
23
24 int SkFontHost::GetTableTags(SkFontID fontID, SkFontTableTag tags[]) {
25 SkStream* stream = SkFontHost::OpenStream(fontID);
26 if (NULL == stream) {
27 return 0;
28 }
29
30 SkAutoUnref au(stream);
31 int ttcIndex = 0;
32 return SkFontStream::GetTableTags(stream, ttcIndex, tags);
33 }
34
35 size_t SkFontHost::GetTableSize(SkFontID fontID, SkFontTableTag tag) {
36 SkStream* stream = SkFontHost::OpenStream(fontID);
37 if (NULL == stream) {
38 return 0;
39 }
40
41 SkAutoUnref au(stream);
42 int ttcIndex = 0;
43 return SkFontStream::GetTableData(stream, ttcIndex, tag, 0, ~0U, NULL);
44 }
45
46 size_t SkFontHost::GetTableData(SkFontID fontID, SkFontTableTag tag,
47 size_t offset, size_t length, void* data) {
48 SkStream* stream = SkFontHost::OpenStream(fontID);
49 if (NULL == stream) {
50 return 0;
51 }
52
53 SkAutoUnref au(stream);
54 int ttcIndex = 0;
55 return SkFontStream::GetTableData(stream, ttcIndex, tag, offset, length, dat a);
56 }
OLDNEW
« no previous file with comments | « trunk/src/ports/SkFontHost_mac.cpp ('k') | trunk/src/ports/SkHarfBuzzFont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698