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

Side by Side Diff: src/ports/SkFontHost_FreeType.cpp

Issue 2163833004: exclude unused functions when mac uses freetype (for pdf) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make onGetAdvancedTypefaceMetrics compile on mac instead 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 | no next file » | 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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkAdvancedTypefaceMetrics.h" 8 #include "SkAdvancedTypefaceMetrics.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 SkASSERT(glyphIndex < SkToUInt(numGlyphs)); 449 SkASSERT(glyphIndex < SkToUInt(numGlyphs));
450 (*glyphToUnicode)[glyphIndex] = charCode; 450 (*glyphToUnicode)[glyphIndex] = charCode;
451 charCode = FT_Get_Next_Char(face, charCode, &glyphIndex); 451 charCode = FT_Get_Next_Char(face, charCode, &glyphIndex);
452 } 452 }
453 } 453 }
454 454
455 SkAdvancedTypefaceMetrics* SkTypeface_FreeType::onGetAdvancedTypefaceMetrics( 455 SkAdvancedTypefaceMetrics* SkTypeface_FreeType::onGetAdvancedTypefaceMetrics(
456 PerGlyphInfo perGlyphInfo, 456 PerGlyphInfo perGlyphInfo,
457 const uint32_t* glyphIDs, 457 const uint32_t* glyphIDs,
458 uint32_t glyphIDsCount) const { 458 uint32_t glyphIDsCount) const {
459 #if defined(SK_BUILD_FOR_MAC)
460 return nullptr;
461 #else
462 AutoFTAccess fta(this); 459 AutoFTAccess fta(this);
463 FT_Face face = fta.face(); 460 FT_Face face = fta.face();
464 if (!face) { 461 if (!face) {
465 return nullptr; 462 return nullptr;
466 } 463 }
467 464
468 SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics; 465 SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics;
469 info->fFontName.set(FT_Get_Postscript_Name(face)); 466 info->fFontName.set(FT_Get_Postscript_Name(face));
470 info->fFlags = SkAdvancedTypefaceMetrics::kEmpty_FontFlag; 467 info->fFlags = SkAdvancedTypefaceMetrics::kEmpty_FontFlag;
471 if (FT_HAS_MULTIPLE_MASTERS(face)) { 468 if (FT_HAS_MULTIPLE_MASTERS(face)) {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 } 644 }
648 } 645 }
649 646
650 if (perGlyphInfo & kToUnicode_PerGlyphInfo && 647 if (perGlyphInfo & kToUnicode_PerGlyphInfo &&
651 info->fType != SkAdvancedTypefaceMetrics::kType1_Font && 648 info->fType != SkAdvancedTypefaceMetrics::kType1_Font &&
652 face->num_charmaps) { 649 face->num_charmaps) {
653 populate_glyph_to_unicode(face, &(info->fGlyphToUnicode)); 650 populate_glyph_to_unicode(face, &(info->fGlyphToUnicode));
654 } 651 }
655 652
656 return info; 653 return info;
657 #endif
658 } 654 }
659 655
660 /////////////////////////////////////////////////////////////////////////// 656 ///////////////////////////////////////////////////////////////////////////
661 657
662 static bool bothZero(SkScalar a, SkScalar b) { 658 static bool bothZero(SkScalar a, SkScalar b) {
663 return 0 == a && 0 == b; 659 return 0 == a && 0 == b;
664 } 660 }
665 661
666 // returns false if there is any non-90-rotation or skew 662 // returns false if there is any non-90-rotation or skew
667 static bool isAxisAligned(const SkScalerContext::Rec& rec) { 663 static bool isAxisAligned(const SkScalerContext::Rec& rec) {
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1836 SkDEBUGF(("Requested font axis not found: %s '%c%c%c%c'\n", 1832 SkDEBUGF(("Requested font axis not found: %s '%c%c%c%c'\n",
1837 name.c_str(), 1833 name.c_str(),
1838 (skTag >> 24) & 0xFF, 1834 (skTag >> 24) & 0xFF,
1839 (skTag >> 16) & 0xFF, 1835 (skTag >> 16) & 0xFF,
1840 (skTag >> 8) & 0xFF, 1836 (skTag >> 8) & 0xFF,
1841 (skTag) & 0xFF)); 1837 (skTag) & 0xFF));
1842 } 1838 }
1843 } 1839 }
1844 ) 1840 )
1845 } 1841 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698