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

Side by Side Diff: src/ports/SkFontMgr_android_factory.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 unified diff | Download patch
« no previous file with comments | « src/ports/SkFontMgr_android.cpp ('k') | 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
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkFontMgr.h"
9 #include "SkFontMgr_android.h"
10
11 // For test only.
12 static const char* gTestFontsXml = NULL;
13 static const char* gTestFallbackFontsXml = NULL;
14 static const char* gTestBasePath = NULL;
15
16 void SkUseTestFontConfigFile(const char* fontsXml, const char* fallbackFontsXml,
17 const char* basePath)
18 {
19 gTestFontsXml = fontsXml;
20 gTestFallbackFontsXml = fallbackFontsXml;
21 gTestBasePath = basePath;
22 SkASSERT(gTestFontsXml);
23 SkASSERT(gTestFallbackFontsXml);
24 SkASSERT(gTestBasePath);
25 SkDEBUGF(("Test BasePath: %s Fonts: %s FallbackFonts: %s\n",
26 gTestBasePath, gTestFontsXml, gTestFallbackFontsXml));
27 }
28
29 SkFontMgr* SkFontMgr::Factory() {
30 // These globals exist so that Chromium can override the environment.
31 // TODO: these globals need to be removed, and Chromium use SkFontMgr_New_An droid instead.
32 if ((gTestFontsXml || gTestFallbackFontsXml) && gTestBasePath) {
33 SkFontMgr_Android_CustomFonts custom = {
34 SkFontMgr_Android_CustomFonts::kOnlyCustom,
35 gTestBasePath,
36 gTestFontsXml,
37 gTestFallbackFontsXml
38 };
39 return SkFontMgr_New_Android(&custom);
40 }
41
42 return SkFontMgr_New_Android(NULL);
43 }
OLDNEW
« no previous file with comments | « src/ports/SkFontMgr_android.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698