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

Side by Side Diff: gm/verttext2.cpp

Issue 1256903002: make fontscalar gammatext lcdtext typeface verttext2 gm portable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove useless gm; fix nit Created 5 years, 4 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 | « gm/typeface.cpp ('k') | tools/sk_tool_utils.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 /* Tests text vertical text rendering with different fonts and centering. 10 /* Tests text vertical text rendering with different fonts and centering.
(...skipping 14 matching lines...) Expand all
25 25
26 virtual ~VertText2GM() { 26 virtual ~VertText2GM() {
27 SkSafeUnref(fProp); 27 SkSafeUnref(fProp);
28 SkSafeUnref(fMono); 28 SkSafeUnref(fMono);
29 } 29 }
30 30
31 protected: 31 protected:
32 void onOnceBeforeDraw() override { 32 void onOnceBeforeDraw() override {
33 const int pointSize = 24; 33 const int pointSize = 24;
34 textHeight = SkIntToScalar(pointSize); 34 textHeight = SkIntToScalar(pointSize);
35 fProp = sk_tool_utils::create_portable_typeface("Helvetica", SkTypeface: :kNormal); 35 fProp = SkTypeface::CreateFromName(sk_tool_utils::platform_font_name("sa ns-serif"),
36 fMono = sk_tool_utils::create_portable_typeface("Courier New", SkTypefac e::kNormal); 36 SkTypeface::kNormal);
37 fMono = SkTypeface::CreateFromName(sk_tool_utils::platform_font_name("mo nospace"),
38 SkTypeface::kNormal);
37 } 39 }
38 40
39 SkString onShortName() override { 41 SkString onShortName() override {
40 return SkString("verttext2"); 42 SkString name("verttext2");
43 name.append(sk_tool_utils::major_platform_os_name());
44 return name;
41 } 45 }
42 46
43 SkISize onISize() override { return SkISize::Make(640, 480); } 47 SkISize onISize() override { return SkISize::Make(640, 480); }
44 48
45 void onDraw(SkCanvas* canvas) override { 49 void onDraw(SkCanvas* canvas) override {
46 for (int i = 0; i < 3; ++i) { 50 for (int i = 0; i < 3; ++i) {
47 SkPaint paint; 51 SkPaint paint;
48 paint.setColor(SK_ColorRED); 52 paint.setColor(SK_ColorRED);
49 paint.setAntiAlias(true); 53 paint.setAntiAlias(true);
50 y = textHeight; 54 y = textHeight;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 SkTypeface* fProp; 96 SkTypeface* fProp;
93 SkTypeface* fMono; 97 SkTypeface* fMono;
94 }; 98 };
95 99
96 /////////////////////////////////////////////////////////////////////////////// 100 ///////////////////////////////////////////////////////////////////////////////
97 101
98 static GM* MyFactory(void*) { return new VertText2GM; } 102 static GM* MyFactory(void*) { return new VertText2GM; }
99 static GMRegistry reg(MyFactory); 103 static GMRegistry reg(MyFactory);
100 104
101 } 105 }
OLDNEW
« no previous file with comments | « gm/typeface.cpp ('k') | tools/sk_tool_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698