| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 <ctype.h> | 8 #include <ctype.h> |
| 9 | 9 |
| 10 #include "SkData.h" | 10 #include "SkData.h" |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 delete[] (unsigned char*)ptr; | 585 delete[] (unsigned char*)ptr; |
| 586 } | 586 } |
| 587 #endif | 587 #endif |
| 588 | 588 |
| 589 #if defined(SK_SFNTLY_SUBSETTER) | 589 #if defined(SK_SFNTLY_SUBSETTER) |
| 590 static size_t get_subset_font_stream(const char* fontName, | 590 static size_t get_subset_font_stream(const char* fontName, |
| 591 const SkTypeface* typeface, | 591 const SkTypeface* typeface, |
| 592 const SkTDArray<uint32_t>& subset, | 592 const SkTDArray<uint32_t>& subset, |
| 593 SkPDFStream** fontStream) { | 593 SkPDFStream** fontStream) { |
| 594 int ttcIndex; | 594 int ttcIndex; |
| 595 std::unique_ptr<SkStream> fontData(typeface->openStream(&ttcIndex)); | 595 std::unique_ptr<SkStreamAsset> fontData(typeface->openStream(&ttcIndex)); |
| 596 SkASSERT(fontData); | 596 SkASSERT(fontData); |
| 597 if (!fontData) { | 597 if (!fontData) { |
| 598 return 0; | 598 return 0; |
| 599 } | 599 } |
| 600 | 600 |
| 601 size_t fontSize = fontData->getLength(); | 601 size_t fontSize = fontData->getLength(); |
| 602 | 602 |
| 603 // Read font into buffer. | 603 // Read font into buffer. |
| 604 SkPDFStream* subsetFontStream = nullptr; | 604 SkPDFStream* subsetFontStream = nullptr; |
| 605 SkTDArray<unsigned char> originalFont; | 605 SkTDArray<unsigned char> originalFont; |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1436 } | 1436 } |
| 1437 return *canon->fCanEmbedTypeface.set(id, canEmbed); | 1437 return *canon->fCanEmbedTypeface.set(id, canEmbed); |
| 1438 } | 1438 } |
| 1439 | 1439 |
| 1440 void SkPDFFont::drop() { | 1440 void SkPDFFont::drop() { |
| 1441 fTypeface = nullptr; | 1441 fTypeface = nullptr; |
| 1442 fFontInfo = nullptr; | 1442 fFontInfo = nullptr; |
| 1443 fDescriptor = nullptr; | 1443 fDescriptor = nullptr; |
| 1444 this->SkPDFDict::drop(); | 1444 this->SkPDFDict::drop(); |
| 1445 } | 1445 } |
| OLD | NEW |