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

Unified Diff: src/ports/SkFontMgr_android.cpp

Issue 1190993002: Move Android SkFontMgr::Factory to its own file. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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 | « include/ports/SkTypeface_android.h ('k') | src/ports/SkFontMgr_android_factory.cpp » ('j') | 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 a67c6814eaa0b56b1bff8385548786ecae3bc1b5..f176b9cbecbd68c3346628a7d0708fea14a3a638 100644
--- a/src/ports/SkFontMgr_android.cpp
+++ b/src/ports/SkFontMgr_android.cpp
@@ -15,16 +15,10 @@
#include "SkTDArray.h"
#include "SkTSearch.h"
#include "SkTypeface.h"
-#include "SkTypeface_android.h"
#include "SkTypefaceCache.h"
#include <limits>
-// For test only.
-static const char* gTestFontsXml = NULL;
-static const char* gTestFallbackFontsXml = NULL;
-static const char* gTestBasePath = NULL;
-
class SkTypeface_Android : public SkTypeface_FreeType {
public:
SkTypeface_Android(const SkFontStyle& style,
@@ -574,7 +568,6 @@ private:
typedef SkFontMgr INHERITED;
};
-///////////////////////////////////////////////////////////////////////////////
#ifdef SK_DEBUG
static char const * const gSystemFontUseStrings[] = {
"OnlyCustom", "PreferCustom", "PreferSystem"
@@ -593,32 +586,3 @@ SkFontMgr* SkFontMgr_New_Android(const SkFontMgr_Android_CustomFonts* custom) {
return SkNEW_ARGS(SkFontMgr_Android, (custom));
}
-
-SkFontMgr* SkFontMgr::Factory() {
- // These globals exist so that Chromium can override the environment.
- // TODO: these globals need to be removed, and Chromium use SkFontMgr_New_Android instead.
- if ((gTestFontsXml || gTestFallbackFontsXml) && gTestBasePath) {
- SkFontMgr_Android_CustomFonts custom = {
- SkFontMgr_Android_CustomFonts::kOnlyCustom,
- gTestBasePath,
- gTestFontsXml,
- gTestFallbackFontsXml
- };
- return SkFontMgr_New_Android(&custom);
- }
-
- return SkFontMgr_New_Android(NULL);
-}
-
-void SkUseTestFontConfigFile(const char* fontsXml, const char* fallbackFontsXml,
- const char* basePath)
-{
- gTestFontsXml = fontsXml;
- gTestFallbackFontsXml = fallbackFontsXml;
- gTestBasePath = basePath;
- SkASSERT(gTestFontsXml);
- SkASSERT(gTestFallbackFontsXml);
- SkASSERT(gTestBasePath);
- SkDEBUGF(("Test BasePath: %s Fonts: %s FallbackFonts: %s\n",
- gTestBasePath, gTestFontsXml, gTestFallbackFontsXml));
-}
« no previous file with comments | « include/ports/SkTypeface_android.h ('k') | src/ports/SkFontMgr_android_factory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698