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

Side by Side Diff: gm/fontmgr.cpp

Issue 23555004: export SkFontMgr_New_... experimental functions for testing in chrome (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | include/ports/SkTypeface_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkFontMgr.h" 10 #include "SkFontMgr.h"
11 #include "SkGraphics.h" 11 #include "SkGraphics.h"
12 #include "SkTypeface.h" 12 #include "SkTypeface.h"
13 13
14 #ifdef SK_BUILD_FOR_WIN 14 #ifdef SK_BUILD_FOR_WIN
15 extern SkFontMgr* SkFontMgr_New_GDI(); 15 #include "SkTypeface_win.h"
16 extern SkFontMgr* SkFontMgr_New_DirectWrite();
17 #endif 16 #endif
18 17
19 // limit this just so we don't take too long to draw 18 // limit this just so we don't take too long to draw
20 #define MAX_FAMILIES 30 19 #define MAX_FAMILIES 30
21 20
22 static SkScalar drawString(SkCanvas* canvas, const SkString& text, SkScalar x, 21 static SkScalar drawString(SkCanvas* canvas, const SkString& text, SkScalar x,
23 SkScalar y, const SkPaint& paint) { 22 SkScalar y, const SkPaint& paint) {
24 canvas->drawText(text.c_str(), text.size(), x, y, paint); 23 canvas->drawText(text.c_str(), text.size(), x, y, paint);
25 return x + paint.measureText(text.c_str(), text.size()); 24 return x + paint.measureText(text.c_str(), text.size());
26 } 25 }
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 }; 192 };
194 193
195 ////////////////////////////////////////////////////////////////////////////// 194 //////////////////////////////////////////////////////////////////////////////
196 195
197 DEF_GM( return SkNEW(FontMgrGM); ) 196 DEF_GM( return SkNEW(FontMgrGM); )
198 DEF_GM( return SkNEW(FontMgrMatchGM); ) 197 DEF_GM( return SkNEW(FontMgrMatchGM); )
199 198
200 #ifdef SK_BUILD_FOR_WIN 199 #ifdef SK_BUILD_FOR_WIN
201 DEF_GM( return SkNEW_ARGS(FontMgrGM, (SkFontMgr_New_DirectWrite)); ) 200 DEF_GM( return SkNEW_ARGS(FontMgrGM, (SkFontMgr_New_DirectWrite)); )
202 #endif 201 #endif
OLDNEW
« no previous file with comments | « no previous file | include/ports/SkTypeface_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698