| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2008 Google Inc. | 2 * Copyright 2008 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 #include "SkFontConfigInterface.h" | 8 #include "SkFontConfigInterface.h" |
| 9 #include "SkFontDescriptor.h" | 9 #include "SkFontDescriptor.h" |
| 10 #include "SkFontHost.h" | 10 #include "SkFontHost.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 SkAutoTUnref<SkFontConfigInterface> fci(RefFCI()); | 237 SkAutoTUnref<SkFontConfigInterface> fci(RefFCI()); |
| 238 if (NULL == fci.get()) { | 238 if (NULL == fci.get()) { |
| 239 return NULL; | 239 return NULL; |
| 240 } | 240 } |
| 241 stream = fci->openStream(this->getIdentity()); | 241 stream = fci->openStream(this->getIdentity()); |
| 242 *ttcIndex = this->getIdentity().fTTCIndex; | 242 *ttcIndex = this->getIdentity().fTTCIndex; |
| 243 } | 243 } |
| 244 return stream; | 244 return stream; |
| 245 } | 245 } |
| 246 | 246 |
| 247 SkStream* SkFontHost::OpenStream(uint32_t) { | |
| 248 SkASSERT(!"SkFontHost::OpenStream is DEPRECATED: call SkTypeface::openStream
\n"); | |
| 249 return NULL; | |
| 250 } | |
| 251 | |
| 252 /////////////////////////////////////////////////////////////////////////////// | |
| 253 | |
| 254 int FontConfigTypeface::onGetTableTags(SkFontTableTag tags[]) const { | 247 int FontConfigTypeface::onGetTableTags(SkFontTableTag tags[]) const { |
| 255 int ttcIndex; | 248 int ttcIndex; |
| 256 SkAutoTUnref<SkStream> stream(this->openStream(&ttcIndex)); | 249 SkAutoTUnref<SkStream> stream(this->openStream(&ttcIndex)); |
| 257 return stream.get() | 250 return stream.get() |
| 258 ? SkFontStream::GetTableTags(stream, ttcIndex, tags) | 251 ? SkFontStream::GetTableTags(stream, ttcIndex, tags) |
| 259 : 0; | 252 : 0; |
| 260 } | 253 } |
| 261 | 254 |
| 262 size_t FontConfigTypeface::onGetTableData(SkFontTableTag tag, size_t offset, | 255 size_t FontConfigTypeface::onGetTableData(SkFontTableTag tag, size_t offset, |
| 263 size_t length, void* data) const { | 256 size_t length, void* data) const { |
| 264 int ttcIndex; | 257 int ttcIndex; |
| 265 SkAutoTUnref<SkStream> stream(this->openStream(&ttcIndex)); | 258 SkAutoTUnref<SkStream> stream(this->openStream(&ttcIndex)); |
| 266 return stream.get() | 259 return stream.get() |
| 267 ? SkFontStream::GetTableData(stream, ttcIndex, | 260 ? SkFontStream::GetTableData(stream, ttcIndex, |
| 268 tag, offset, length, data) | 261 tag, offset, length, data) |
| 269 : 0; | 262 : 0; |
| 270 } | 263 } |
| 271 | 264 |
| 272 void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc) const { | 265 void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc) const { |
| 273 desc->setStyle(this->style()); | 266 desc->setStyle(this->style()); |
| 274 desc->setFamilyName(this->getFamilyName()); | 267 desc->setFamilyName(this->getFamilyName()); |
| 275 } | 268 } |
| OLD | NEW |