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

Side by Side Diff: tests/FontConfigParser.cpp

Issue 890073002: Update dump code in FontConfigParser test. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 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 "Resources.h" 8 #include "Resources.h"
9 #include "SkFontConfigParser_android.h" 9 #include "SkFontConfigParser_android.h"
10 #include "Test.h" 10 #include "Test.h"
(...skipping 15 matching lines...) Expand all
26 REPORTER_ASSERT(reporter, 26 REPORTER_ASSERT(reporter,
27 !strcmp(fontFamilies[0]->fFonts[0].fFileName.c_str(), firstE xpectedFile)); 27 !strcmp(fontFamilies[0]->fFonts[0].fFileName.c_str(), firstE xpectedFile));
28 REPORTER_ASSERT(reporter, !fontFamilies[0]->fIsFallbackFont); 28 REPORTER_ASSERT(reporter, !fontFamilies[0]->fIsFallbackFont);
29 } 29 }
30 30
31 void DumpLoadedFonts(SkTDArray<FontFamily*> fontFamilies) { 31 void DumpLoadedFonts(SkTDArray<FontFamily*> fontFamilies) {
32 #if SK_DEBUG_FONTS 32 #if SK_DEBUG_FONTS
33 for (int i = 0; i < fontFamilies.count(); ++i) { 33 for (int i = 0; i < fontFamilies.count(); ++i) {
34 SkDebugf("Family %d:\n", i); 34 SkDebugf("Family %d:\n", i);
35 switch(fontFamilies[i]->fVariant) { 35 switch(fontFamilies[i]->fVariant) {
36 case SkPaintOptionsAndroid::kElegant_Variant: SkDebugf(" elegant"); break; 36 case kElegant_FontVariant: SkDebugf(" elegant\n"); break;
37 case SkPaintOptionsAndroid::kCompact_Variant: SkDebugf(" compact"); break; 37 case kCompact_FontVariant: SkDebugf(" compact\n"); break;
38 default: break; 38 default: break;
39 } 39 }
40 if (!fontFamilies[i]->fLanguage.getTag().isEmpty()) { 40 if (!fontFamilies[i]->fLanguage.getTag().isEmpty()) {
41 SkDebugf(" language: %s", fontFamilies[i]->fLanguage.getTag().c_str ()); 41 SkDebugf(" language %s\n", fontFamilies[i]->fLanguage.getTag().c_st r());
42 } 42 }
43 for (int j = 0; j < fontFamilies[i]->fNames.count(); ++j) { 43 for (int j = 0; j < fontFamilies[i]->fNames.count(); ++j) {
44 SkDebugf(" name %s\n", fontFamilies[i]->fNames[j].c_str()); 44 SkDebugf(" name %s\n", fontFamilies[i]->fNames[j].c_str());
45 } 45 }
46 for (int j = 0; j < fontFamilies[i]->fFonts.count(); ++j) { 46 for (int j = 0; j < fontFamilies[i]->fFonts.count(); ++j) {
47 const FontFileInfo& ffi = fontFamilies[i]->fFonts[j]; 47 const FontFileInfo& ffi = fontFamilies[i]->fFonts[j];
48 SkDebugf(" file (%d %s %d) %s\n", 48 SkDebugf(" file (%d) %s#%d\n", ffi.fWeight, ffi.fFileName.c_str(), ffi.fIndex);
49 ffi.fWeight,
50 ffi.fPaintOptions.getLanguage().getTag().isEmpty() ? "" :
51 ffi.fPaintOptions.getLanguage().getTag().c_str(),
52 ffi.fPaintOptions.getFontVariant(),
53 ffi.fFileName.c_str());
54 } 49 }
55 } 50 }
56 #endif // SK_DEBUG_FONTS 51 #endif // SK_DEBUG_FONTS
57 } 52 }
58 53
59 DEF_TEST(FontConfigParserAndroid, reporter) { 54 DEF_TEST(FontConfigParserAndroid, reporter) {
60 55
61 bool resourcesMissing = false; 56 bool resourcesMissing = false;
62 57
63 SkTDArray<FontFamily*> preV17FontFamilies; 58 SkTDArray<FontFamily*> preV17FontFamilies;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 ValidateLoadedFonts(v22FontFamilies, "Roboto-Thin.ttf", reporter); 100 ValidateLoadedFonts(v22FontFamilies, "Roboto-Thin.ttf", reporter);
106 } else { 101 } else {
107 resourcesMissing = true; 102 resourcesMissing = true;
108 } 103 }
109 104
110 if (resourcesMissing) { 105 if (resourcesMissing) {
111 SkDebugf("---- Resource files missing for FontConfigParser test\n"); 106 SkDebugf("---- Resource files missing for FontConfigParser test\n");
112 } 107 }
113 } 108 }
114 109
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