OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkTypes.h" | 8 #include "SkTypes.h" |
9 // SkTypes will include Windows.h, which will pull in all of the GDI defines. | 9 // SkTypes will include Windows.h, which will pull in all of the GDI defines. |
10 // GDI #defines GetGlyphIndices to GetGlyphIndicesA or GetGlyphIndicesW, but | 10 // GDI #defines GetGlyphIndices to GetGlyphIndicesA or GetGlyphIndicesW, but |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 int DWriteFontTypeface::onGetTableTags(SkFontTableTag tags[]) const { | 179 int DWriteFontTypeface::onGetTableTags(SkFontTableTag tags[]) const { |
180 DWRITE_FONT_FACE_TYPE type = fDWriteFontFace->GetType(); | 180 DWRITE_FONT_FACE_TYPE type = fDWriteFontFace->GetType(); |
181 if (type != DWRITE_FONT_FACE_TYPE_CFF && | 181 if (type != DWRITE_FONT_FACE_TYPE_CFF && |
182 type != DWRITE_FONT_FACE_TYPE_TRUETYPE && | 182 type != DWRITE_FONT_FACE_TYPE_TRUETYPE && |
183 type != DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION) | 183 type != DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION) |
184 { | 184 { |
185 return 0; | 185 return 0; |
186 } | 186 } |
187 | 187 |
188 int ttcIndex; | 188 int ttcIndex; |
189 SkAutoTUnref<SkStream> stream(this->openStream(&ttcIndex)); | 189 SkAutoTDelete<SkStream> stream(this->openStream(&ttcIndex)); |
190 return stream.get() ? SkFontStream::GetTableTags(stream, ttcIndex, tags) : 0
; | 190 return stream.get() ? SkFontStream::GetTableTags(stream, ttcIndex, tags) : 0
; |
191 } | 191 } |
192 | 192 |
193 size_t DWriteFontTypeface::onGetTableData(SkFontTableTag tag, size_t offset, | 193 size_t DWriteFontTypeface::onGetTableData(SkFontTableTag tag, size_t offset, |
194 size_t length, void* data) const | 194 size_t length, void* data) const |
195 { | 195 { |
196 AutoDWriteTable table(fDWriteFontFace.get(), SkEndian_SwapBE32(tag)); | 196 AutoDWriteTable table(fDWriteFontFace.get(), SkEndian_SwapBE32(tag)); |
197 if (!table.fExists) { | 197 if (!table.fExists) { |
198 return 0; | 198 return 0; |
199 } | 199 } |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 getAdvanceData(fDWriteFontFace.get(), | 458 getAdvanceData(fDWriteFontFace.get(), |
459 glyphCount, | 459 glyphCount, |
460 glyphIDs, | 460 glyphIDs, |
461 glyphIDsCount, | 461 glyphIDsCount, |
462 getWidthAdvance)); | 462 getWidthAdvance)); |
463 } | 463 } |
464 } | 464 } |
465 | 465 |
466 return info; | 466 return info; |
467 } | 467 } |
OLD | NEW |