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

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

Issue 1057413005: Remove filename from SkFontDescriptor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add file name to assert. Created 5 years, 8 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/ports/SkFontHost_linux.cpp ('k') | src/ports/SkFontMgr_fontconfig.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 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 "SkFontConfigParser_android.h" 8 #include "SkFontConfigParser_android.h"
9 #include "SkFontDescriptor.h" 9 #include "SkFontDescriptor.h"
10 #include "SkFontHost_FreeType_common.h" 10 #include "SkFontHost_FreeType_common.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 : INHERITED(index, style, isFixedPitch, familyName) 59 : INHERITED(index, style, isFixedPitch, familyName)
60 , fPathName(pathName) 60 , fPathName(pathName)
61 , fLang(lang) 61 , fLang(lang)
62 , fVariantStyle(variantStyle) { } 62 , fVariantStyle(variantStyle) { }
63 63
64 virtual void onGetFontDescriptor(SkFontDescriptor* desc, 64 virtual void onGetFontDescriptor(SkFontDescriptor* desc,
65 bool* serialize) const override { 65 bool* serialize) const override {
66 SkASSERT(desc); 66 SkASSERT(desc);
67 SkASSERT(serialize); 67 SkASSERT(serialize);
68 desc->setFamilyName(fFamilyName.c_str()); 68 desc->setFamilyName(fFamilyName.c_str());
69 desc->setFontFileName(fPathName.c_str());
70 desc->setFontIndex(fIndex); 69 desc->setFontIndex(fIndex);
71 *serialize = false; 70 *serialize = false;
72 } 71 }
73 SkStreamAsset* onOpenStream(int* ttcIndex) const override { 72 SkStreamAsset* onOpenStream(int* ttcIndex) const override {
74 *ttcIndex = fIndex; 73 *ttcIndex = fIndex;
75 return SkStream::NewFromFile(fPathName.c_str()); 74 return SkStream::NewFromFile(fPathName.c_str());
76 } 75 }
77 76
78 const SkString fPathName; 77 const SkString fPathName;
79 const SkLanguage fLang; 78 const SkLanguage fLang;
(...skipping 10 matching lines...) Expand all
90 bool isFixedPitch, 89 bool isFixedPitch,
91 const SkString& familyName) 90 const SkString& familyName)
92 : INHERITED(index, style, isFixedPitch, familyName) 91 : INHERITED(index, style, isFixedPitch, familyName)
93 , fStream(stream) { } 92 , fStream(stream) { }
94 93
95 virtual void onGetFontDescriptor(SkFontDescriptor* desc, 94 virtual void onGetFontDescriptor(SkFontDescriptor* desc,
96 bool* serialize) const override { 95 bool* serialize) const override {
97 SkASSERT(desc); 96 SkASSERT(desc);
98 SkASSERT(serialize); 97 SkASSERT(serialize);
99 desc->setFamilyName(fFamilyName.c_str()); 98 desc->setFamilyName(fFamilyName.c_str());
100 desc->setFontFileName(NULL);
101 *serialize = true; 99 *serialize = true;
102 } 100 }
103 101
104 SkStreamAsset* onOpenStream(int* ttcIndex) const override { 102 SkStreamAsset* onOpenStream(int* ttcIndex) const override {
105 *ttcIndex = fIndex; 103 *ttcIndex = fIndex;
106 return fStream->duplicate(); 104 return fStream->duplicate();
107 } 105 }
108 106
109 private: 107 private:
110 SkAutoTDelete<SkStreamAsset> fStream; 108 SkAutoTDelete<SkStreamAsset> fStream;
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 { 538 {
541 gTestFontsXml = fontsXml; 539 gTestFontsXml = fontsXml;
542 gTestFallbackFontsXml = fallbackFontsXml; 540 gTestFallbackFontsXml = fallbackFontsXml;
543 gTestBasePath = basePath; 541 gTestBasePath = basePath;
544 SkASSERT(gTestFontsXml); 542 SkASSERT(gTestFontsXml);
545 SkASSERT(gTestFallbackFontsXml); 543 SkASSERT(gTestFallbackFontsXml);
546 SkASSERT(gTestBasePath); 544 SkASSERT(gTestBasePath);
547 SkDEBUGF(("Test BasePath: %s Fonts: %s FallbackFonts: %s\n", 545 SkDEBUGF(("Test BasePath: %s Fonts: %s FallbackFonts: %s\n",
548 gTestBasePath, gTestFontsXml, gTestFallbackFontsXml)); 546 gTestBasePath, gTestFontsXml, gTestFallbackFontsXml));
549 } 547 }
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_linux.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698