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

Unified Diff: src/ports/SkFontMgr_android.cpp

Issue 491733003: HACK NOT FOR COMMIT time font init Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix gyp Created 6 years, 4 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 | « gyp/ports.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontMgr_android.cpp
diff --git a/src/ports/SkFontMgr_android.cpp b/src/ports/SkFontMgr_android.cpp
index e966c84f1ff4054cce84cc66ab2caf0b7a3844ef..991993e4d226549b86330cc9e43273952fc9aafe 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -39,6 +39,11 @@ static const char* gTestMainConfigFile = NULL;
static const char* gTestFallbackConfigFile = NULL;
static const char* gTestFontFilePrefix = NULL;
+// HACK
+#include "../../tools/timer/Timer.h"
+static Timer gTimer;
+static double gTime = 0.0;
+
class SkTypeface_Android : public SkTypeface_FreeType {
public:
SkTypeface_Android(int index,
@@ -141,6 +146,7 @@ public:
cannonicalFamilyName = &family.fNames[0];
}
// TODO? make this lazy
+gTimer.start();
for (int i = 0; i < family.fFonts.count(); ++i) {
const FontFileInfo& fontFile = family.fFonts[i];
@@ -181,6 +187,8 @@ public:
style, isFixedWidth, familyName,
lang, variant)));
}
+gTimer.end();
+gTime += gTimer.fCpu;
}
virtual int count() SK_OVERRIDE {
@@ -271,6 +279,7 @@ public:
SkFontConfigParser::GetFontFamilies(fontFamilies);
this->buildNameToFamilyMap(fontFamilies, NULL);
this->findDefaultFont();
+SkDebugf("Elapsed CPU time building font families: %g ms\n", gTime);
}
SkFontMgr_Android(const char* mainConfigFile, const char* fallbackConfigFile,
const char* basePath)
« no previous file with comments | « gyp/ports.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698