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

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

Issue 1193553002: simplify release-proc for SkData, removing unneeded size param (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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 | « src/core/SkData.cpp ('k') | tests/DataRefTest.cpp » ('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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 append_tounicode_header(&cmap, 1, lastGlyphID - firstGlyphID + 1); 571 append_tounicode_header(&cmap, 1, lastGlyphID - firstGlyphID + 1);
572 } 572 }
573 append_cmap_sections(glyphToUnicode, subset, &cmap, multiByteGlyphs, 573 append_cmap_sections(glyphToUnicode, subset, &cmap, multiByteGlyphs,
574 firstGlyphID, lastGlyphID); 574 firstGlyphID, lastGlyphID);
575 append_cmap_footer(&cmap); 575 append_cmap_footer(&cmap);
576 SkAutoTUnref<SkData> cmapData(cmap.copyToData()); 576 SkAutoTUnref<SkData> cmapData(cmap.copyToData());
577 return new SkPDFStream(cmapData.get()); 577 return new SkPDFStream(cmapData.get());
578 } 578 }
579 579
580 #if defined (SK_SFNTLY_SUBSETTER) 580 #if defined (SK_SFNTLY_SUBSETTER)
581 static void sk_delete_array(const void* ptr, size_t, void*) { 581 static void sk_delete_array(const void* ptr, void*) {
582 // Use C-style cast to cast away const and cast type simultaneously. 582 // Use C-style cast to cast away const and cast type simultaneously.
583 delete[] (unsigned char*)ptr; 583 delete[] (unsigned char*)ptr;
584 } 584 }
585 #endif 585 #endif
586 586
587 static size_t get_subset_font_stream(const char* fontName, 587 static size_t get_subset_font_stream(const char* fontName,
588 const SkTypeface* typeface, 588 const SkTypeface* typeface,
589 const SkTDArray<uint32_t>& subset, 589 const SkTDArray<uint32_t>& subset,
590 SkPDFStream** fontStream) { 590 SkPDFStream** fontStream) {
591 int ttcIndex; 591 int ttcIndex;
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 } 1414 }
1415 if (existingFont != NULL) { 1415 if (existingFont != NULL) {
1416 return (existingFont->fFirstGlyphID <= searchGlyphID && 1416 return (existingFont->fFirstGlyphID <= searchGlyphID &&
1417 searchGlyphID <= existingFont->fLastGlyphID) 1417 searchGlyphID <= existingFont->fLastGlyphID)
1418 ? SkPDFFont::kExact_Match 1418 ? SkPDFFont::kExact_Match
1419 : SkPDFFont::kRelated_Match; 1419 : SkPDFFont::kRelated_Match;
1420 } 1420 }
1421 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match 1421 return (existingGlyphID == searchGlyphID) ? SkPDFFont::kExact_Match
1422 : SkPDFFont::kRelated_Match; 1422 : SkPDFFont::kRelated_Match;
1423 } 1423 }
OLDNEW
« no previous file with comments | « src/core/SkData.cpp ('k') | tests/DataRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698