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

Side by Side Diff: gm/fontcache.cpp

Issue 1818043002: SkTypeface::MakeFromName to take SkFontStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Compile fixes Created 4 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
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 "SkGraphics.h" 10 #include "SkGraphics.h"
(...skipping 14 matching lines...) Expand all
25 protected: 25 protected:
26 SkString onShortName() override { 26 SkString onShortName() override {
27 return SkString("fontcache"); 27 return SkString("fontcache");
28 } 28 }
29 29
30 SkISize onISize() override { 30 SkISize onISize() override {
31 return SkISize::Make(1280, 640); 31 return SkISize::Make(1280, 640);
32 } 32 }
33 33
34 void onOnceBeforeDraw() override { 34 void onOnceBeforeDraw() override {
35 fTypefaces[0] = sk_tool_utils::create_portable_typeface("serif", SkTypef ace::kItalic); 35 fTypefaces[0] = sk_tool_utils::create_portable_typeface("serif",
36 fTypefaces[1] = sk_tool_utils::create_portable_typeface("sans-serif", Sk Typeface::kItalic); 36 SkFontStyle::FromOldStyle(SkTypeface::kItalic));
37 fTypefaces[1] = sk_tool_utils::create_portable_typeface("sans-serif",
38 SkFontStyle::FromOldStyle(SkTypeface::kItalic));
bungeman-skia 2016/05/26 15:39:33 nit: this is a bit awkward looking since this line
Mikus 2016/05/30 14:18:39 Done.
37 } 39 }
38 40
39 void onDraw(SkCanvas* canvas) override { 41 void onDraw(SkCanvas* canvas) override {
40 SkPaint paint; 42 SkPaint paint;
41 paint.setAntiAlias(true); 43 paint.setAntiAlias(true);
42 paint.setLCDRenderText(true); 44 paint.setLCDRenderText(true);
43 paint.setSubpixelText(true); 45 paint.setSubpixelText(true);
44 paint.setTypeface(fTypefaces[0]); 46 paint.setTypeface(fTypefaces[0]);
45 paint.setTextSize(192); 47 paint.setTextSize(192);
46 48
(...skipping 22 matching lines...) Expand all
69 71
70 private: 72 private:
71 sk_sp<SkTypeface> fTypefaces[2]; 73 sk_sp<SkTypeface> fTypefaces[2];
72 typedef GM INHERITED; 74 typedef GM INHERITED;
73 }; 75 };
74 76
75 77
76 ////////////////////////////////////////////////////////////////////////////// 78 //////////////////////////////////////////////////////////////////////////////
77 79
78 DEF_GM(return new FontCacheGM;) 80 DEF_GM(return new FontCacheGM;)
OLDNEW
« no previous file with comments | « gm/filterbitmap.cpp ('k') | gm/gammatext.cpp » ('j') | tests/TypefaceTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698