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

Unified Diff: tests/FontConfigParser.cpp

Issue 915443002: Additional cleanups to Android config parsing. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Prevent future bit rot in test debug dump. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ports/SkFontConfigParser_android.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/FontConfigParser.cpp
diff --git a/tests/FontConfigParser.cpp b/tests/FontConfigParser.cpp
index 744a41e5f2900c770ec4e6c1a620796beed53dbe..dfc8093f2a0077526e9e7ed68596b6d3ddc434d9 100644
--- a/tests/FontConfigParser.cpp
+++ b/tests/FontConfigParser.cpp
@@ -6,9 +6,12 @@
*/
#include "Resources.h"
+#include "SkCommandLineFlags.h"
#include "SkFontConfigParser_android.h"
#include "Test.h"
+DECLARE_bool(verboseFontMgr);
+
int CountFallbacks(SkTDArray<FontFamily*> fontFamilies) {
int countOfFallbackFonts = 0;
for (int i = 0; i < fontFamilies.count(); i++) {
@@ -29,7 +32,10 @@ void ValidateLoadedFonts(SkTDArray<FontFamily*> fontFamilies, const char* firstE
}
void DumpLoadedFonts(SkTDArray<FontFamily*> fontFamilies) {
-#if SK_DEBUG_FONTS
+ if (!FLAGS_verboseFontMgr) {
+ return;
+ }
+
for (int i = 0; i < fontFamilies.count(); ++i) {
SkDebugf("Family %d:\n", i);
switch(fontFamilies[i]->fVariant) {
@@ -37,9 +43,7 @@ void DumpLoadedFonts(SkTDArray<FontFamily*> fontFamilies) {
case kCompact_FontVariant: SkDebugf(" compact\n"); break;
default: break;
}
- if (fontFamilies[i]->fBasePath) {
- SkDebugf(" basePath %s\n", fontFamilies[i]->fBasePath);
- }
+ SkDebugf(" basePath %s\n", fontFamilies[i]->fBasePath.c_str());
if (!fontFamilies[i]->fLanguage.getTag().isEmpty()) {
SkDebugf(" language %s\n", fontFamilies[i]->fLanguage.getTag().c_str());
}
@@ -51,7 +55,6 @@ void DumpLoadedFonts(SkTDArray<FontFamily*> fontFamilies) {
SkDebugf(" file (%d) %s#%d\n", ffi.fWeight, ffi.fFileName.c_str(), ffi.fIndex);
}
}
-#endif // SK_DEBUG_FONTS
}
DEF_TEST(FontConfigParserAndroid, reporter) {
« no previous file with comments | « src/ports/SkFontConfigParser_android.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698