aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/fontmgr.cpp
diff options
context:
space:
mode:
authorGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-31 19:18:07 +0000
committerGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-31 19:18:07 +0000
commit6eddc77f6a0078570471277954c07d73b3a921d8 (patch)
treea2050286bf178ef2e6db3231dcab663d5f77af8d /gm/fontmgr.cpp
parent35c03fbf101306e8e82141853de4c664cbafedbb (diff)
Pass the IDWriteFactory instead of relying on a global creator.
There are different variations or implementations of IDWriteFactory with different behaviors. Allow the user to specify the factory to use. R=scottmg@chromium.org Review URL: https://codereview.chromium.org/218833005 git-svn-id: http://skia.googlecode.com/svn/trunk@14000 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/fontmgr.cpp')
-rw-r--r--gm/fontmgr.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/gm/fontmgr.cpp b/gm/fontmgr.cpp
index 4b64821e7e..d9a0aa5f4b 100644
--- a/gm/fontmgr.cpp
+++ b/gm/fontmgr.cpp
@@ -26,13 +26,13 @@ static SkScalar drawString(SkCanvas* canvas, const SkString& text, SkScalar x,
class FontMgrGM : public skiagm::GM {
public:
- FontMgrGM(SkFontMgr* (*factory)() = NULL) {
+ FontMgrGM(SkFontMgr* fontMgr = NULL) {
SkGraphics::SetFontCacheLimit(16 * 1024 * 1024);
fName.set("fontmgr_iter");
- if (factory) {
+ if (fontMgr) {
fName.append("_factory");
- fFM.reset(factory());
+ fFM.reset(fontMgr);
} else {
fFM.reset(SkFontMgr::RefDefault());
}
@@ -195,5 +195,5 @@ DEF_GM( return SkNEW(FontMgrGM); )
DEF_GM( return SkNEW(FontMgrMatchGM); )
#ifdef SK_BUILD_FOR_WIN
- DEF_GM( return SkNEW_ARGS(FontMgrGM, (SkFontMgr_New_DirectWrite)); )
+ DEF_GM( return SkNEW_ARGS(FontMgrGM, (SkFontMgr_New_DirectWrite())); )
#endif