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

Side by Side Diff: src/core/SkTypeface.cpp

Issue 12807004: move impl of AdvancedTypefaceMetrics into typeface (3) (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 The Android Open Source Project 3 * Copyright 2011 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 "SkAdvancedTypefaceMetrics.h" 10 #include "SkAdvancedTypefaceMetrics.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 void SkTypeface::serialize(SkWStream* stream) const { 91 void SkTypeface::serialize(SkWStream* stream) const {
92 SkFontHost::Serialize(this, stream); 92 SkFontHost::Serialize(this, stream);
93 } 93 }
94 94
95 SkTypeface* SkTypeface::Deserialize(SkStream* stream) { 95 SkTypeface* SkTypeface::Deserialize(SkStream* stream) {
96 return SkFontHost::Deserialize(stream); 96 return SkFontHost::Deserialize(stream);
97 } 97 }
98 98
99 SkAdvancedTypefaceMetrics* SkTypeface::getAdvancedTypefaceMetrics( 99 SkAdvancedTypefaceMetrics* SkTypeface::getAdvancedTypefaceMetrics(
100 SkAdvancedTypefaceMetrics::PerGlyphInfo perGlyphInfo, 100 SkAdvancedTypefaceMetrics::PerGlyphInfo info,
101 const uint32_t* glyphIDs, 101 const uint32_t* glyphIDs,
102 uint32_t glyphIDsCount) const { 102 uint32_t glyphIDsCount) const {
103 return SkFontHost::GetAdvancedTypefaceMetrics(fUniqueID, 103 return this->onGetAdvancedTypefaceMetrics(info, glyphIDs, glyphIDsCount);
104 perGlyphInfo,
105 glyphIDs,
106 glyphIDsCount);
107 } 104 }
108 105
109 /////////////////////////////////////////////////////////////////////////////// 106 ///////////////////////////////////////////////////////////////////////////////
110 107
111 int SkTypeface::countTables() const { 108 int SkTypeface::countTables() const {
112 return SkFontHost::CountTables(fUniqueID); 109 return SkFontHost::CountTables(fUniqueID);
113 } 110 }
114 111
115 int SkTypeface::getTableTags(SkFontTableTag tags[]) const { 112 int SkTypeface::getTableTags(SkFontTableTag tags[]) const {
116 return SkFontHost::GetTableTags(fUniqueID, tags); 113 return SkFontHost::GetTableTags(fUniqueID, tags);
(...skipping 17 matching lines...) Expand all
134 return SkFontHost::OpenStream(fUniqueID); 131 return SkFontHost::OpenStream(fUniqueID);
135 } 132 }
136 133
137 int SkTypeface::getUnitsPerEm() const { 134 int SkTypeface::getUnitsPerEm() const {
138 int upem = 0; 135 int upem = 0;
139 136
140 #ifdef SK_BUILD_FOR_ANDROID 137 #ifdef SK_BUILD_FOR_ANDROID
141 upem = SkFontHost::GetUnitsPerEm(fUniqueID); 138 upem = SkFontHost::GetUnitsPerEm(fUniqueID);
142 #else 139 #else
143 SkAdvancedTypefaceMetrics* metrics; 140 SkAdvancedTypefaceMetrics* metrics;
144 metrics = SkFontHost::GetAdvancedTypefaceMetrics(fUniqueID, 141 metrics = this->getAdvancedTypefaceMetrics(
145 SkAdvancedTypefaceMetrics::kNo_PerGlyphInfo, 142 SkAdvancedTypefaceMetrics::kNo_PerGlyphInfo,
146 NULL, 0); 143 NULL, 0);
147 if (metrics) { 144 if (metrics) {
148 upem = metrics->fEmSize; 145 upem = metrics->fEmSize;
149 metrics->unref(); 146 metrics->unref();
150 } 147 }
151 #endif 148 #endif
152 return upem; 149 return upem;
153 } 150 }
154 151
155 /////////////////////////////////////////////////////////////////////////////// 152 ///////////////////////////////////////////////////////////////////////////////
156 /////////////////////////////////////////////////////////////////////////////// 153 ///////////////////////////////////////////////////////////////////////////////
157 154
158 #include "SkFontDescriptor.h" 155 #include "SkFontDescriptor.h"
159 156
160 int SkTypeface::onGetUPEM() const { return 0; } 157 int SkTypeface::onGetUPEM() const { return 0; }
161 int SkTypeface::onGetTableTags(SkFontTableTag tags[]) const { return 0; } 158 int SkTypeface::onGetTableTags(SkFontTableTag tags[]) const { return 0; }
162 size_t SkTypeface::onGetTableData(SkFontTableTag, size_t offset, 159 size_t SkTypeface::onGetTableData(SkFontTableTag, size_t offset,
163 size_t length, void* data) const { return 0; } 160 size_t length, void* data) const { return 0; }
164 void SkTypeface::onGetFontDescriptor(SkFontDescriptor* desc) const { 161 void SkTypeface::onGetFontDescriptor(SkFontDescriptor* desc) const {
165 desc->setStyle(this->style()); 162 desc->setStyle(this->style());
166 } 163 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698