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

Side by Side Diff: gm/bigtext.cpp

Issue 1235343004: make arithmode bigtext colortype* degeneratesegments gm portable (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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/arithmode.cpp ('k') | gm/colortype.cpp » ('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 "SkPath.h" 10 #include "SkPath.h"
(...skipping 13 matching lines...) Expand all
24 return SkString("bigtext"); 24 return SkString("bigtext");
25 } 25 }
26 26
27 SkISize onISize() override { 27 SkISize onISize() override {
28 return SkISize::Make(640, 480); 28 return SkISize::Make(640, 480);
29 } 29 }
30 30
31 void onDraw(SkCanvas* canvas) override { 31 void onDraw(SkCanvas* canvas) override {
32 SkPaint paint; 32 SkPaint paint;
33 paint.setAntiAlias(true); 33 paint.setAntiAlias(true);
34 sk_tool_utils::set_portable_typeface(&paint); 34 sk_tool_utils::set_portable_typeface_always(&paint);
35 paint.setTextSize(1500); 35 paint.setTextSize(1500);
36 36
37 SkRect r; 37 SkRect r;
38 (void)paint.measureText("/", 1, &r); 38 (void)paint.measureText("/", 1, &r);
39 SkPoint pos = { 39 SkPoint pos = {
40 this->width()/2 - r.centerX(), 40 this->width()/2 - r.centerX(),
41 this->height()/2 - r.centerY() 41 this->height()/2 - r.centerY()
42 }; 42 };
43 43
44 paint.setColor(SK_ColorRED); 44 paint.setColor(SK_ColorRED);
45 canvas->drawText("/", 1, pos.fX, pos.fY, paint); 45 canvas->drawText("/", 1, pos.fX, pos.fY, paint);
46 46
47 paint.setColor(SK_ColorBLUE); 47 paint.setColor(SK_ColorBLUE);
48 canvas->drawPosText("\\", 1, &pos, paint); 48 canvas->drawPosText("\\", 1, &pos, paint);
49 } 49 }
50 50
51 private: 51 private:
52 typedef skiagm::GM INHERITED; 52 typedef skiagm::GM INHERITED;
53 }; 53 };
54 54
55 DEF_GM( return SkNEW(BigTextGM); ) 55 DEF_GM( return SkNEW(BigTextGM); )
OLDNEW
« no previous file with comments | « gm/arithmode.cpp ('k') | gm/colortype.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698