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

Side by Side Diff: src/pdf/SkPDFFont.cpp

Issue 2098393002: SkPDF: SkPDFStream takes only SkStreamAsset (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | src/pdf/SkPDFFormXObject.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | src/pdf/SkPDFFormXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698