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

Side by Side Diff: gm/verttext.cpp

Issue 1037793002: C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: git cl web Created 5 years, 8 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/vertices.cpp ('k') | gm/verttext2.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 2011 Google Inc. 2 * Copyright 2011 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 8
9 #include "gm.h" 9 #include "gm.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // : fFace(SkTypeface::CreateFromName("Yuppy SC", SkTypeface::kNormal)) 43 // : fFace(SkTypeface::CreateFromName("Yuppy SC", SkTypeface::kNormal))
44 // : fFace(SkTypeface::CreateFromName("Yuppy TC", SkTypeface::kNormal)) 44 // : fFace(SkTypeface::CreateFromName("Yuppy TC", SkTypeface::kNormal))
45 45
46 { 46 {
47 } 47 }
48 48
49 //SkAutoTUnref<SkTypeface> fFace; 49 //SkAutoTUnref<SkTypeface> fFace;
50 50
51 protected: 51 protected:
52 52
53 SkString onShortName() SK_OVERRIDE { 53 SkString onShortName() override {
54 return SkString("verttext"); 54 return SkString("verttext");
55 } 55 }
56 56
57 SkISize onISize() SK_OVERRIDE { return SkISize::Make(640, 480); } 57 SkISize onISize() override { return SkISize::Make(640, 480); }
58 58
59 static void drawBaseline(SkCanvas* canvas, const SkPaint& paint, 59 static void drawBaseline(SkCanvas* canvas, const SkPaint& paint,
60 SkScalar x, SkScalar y) { 60 SkScalar x, SkScalar y) {
61 SkScalar total = paint.measureText(gText, gLen); 61 SkScalar total = paint.measureText(gText, gLen);
62 62
63 SkPaint p; 63 SkPaint p;
64 p.setAntiAlias(true); 64 p.setAntiAlias(true);
65 p.setColor(0x80FF0000); 65 p.setColor(0x80FF0000);
66 canvas->drawLine(x, y, 66 canvas->drawLine(x, y,
67 paint.isVerticalText() ? x : x + total, 67 paint.isVerticalText() ? x : x + total,
68 paint.isVerticalText() ? y + total : y, 68 paint.isVerticalText() ? y + total : y,
69 p); 69 p);
70 70
71 p.setColor(0xFF0000FF); 71 p.setColor(0xFF0000FF);
72 SkScalar adv[gLen]; 72 SkScalar adv[gLen];
73 int numChars = paint.getTextWidths(gText, gLen, adv, NULL); 73 int numChars = paint.getTextWidths(gText, gLen, adv, NULL);
74 for (int i = 0; i < numChars; ++i) { 74 for (int i = 0; i < numChars; ++i) {
75 canvas->drawCircle(x, y, SK_Scalar1 * 3 / 2, p); 75 canvas->drawCircle(x, y, SK_Scalar1 * 3 / 2, p);
76 if (paint.isVerticalText()) { 76 if (paint.isVerticalText()) {
77 y += adv[i]; 77 y += adv[i];
78 } else { 78 } else {
79 x += adv[i]; 79 x += adv[i];
80 } 80 }
81 } 81 }
82 canvas->drawCircle(x, y, SK_Scalar1 * 3 / 2, p); 82 canvas->drawCircle(x, y, SK_Scalar1 * 3 / 2, p);
83 } 83 }
84 84
85 void onDraw(SkCanvas* canvas) SK_OVERRIDE { 85 void onDraw(SkCanvas* canvas) override {
86 SkScalar x = SkIntToScalar(100); 86 SkScalar x = SkIntToScalar(100);
87 SkScalar y = SkIntToScalar(50); 87 SkScalar y = SkIntToScalar(50);
88 88
89 for (int i = 0; i < 4; ++i) { 89 for (int i = 0; i < 4; ++i) {
90 SkPaint paint; 90 SkPaint paint;
91 paint.setAntiAlias(true); 91 paint.setAntiAlias(true);
92 paint.setTextSize(SkIntToScalar(TEXT_SIZE)); 92 paint.setTextSize(SkIntToScalar(TEXT_SIZE));
93 //paint.setTypeface(fFace); 93 //paint.setTypeface(fFace);
94 //paint.setFakeBoldText(true); 94 //paint.setFakeBoldText(true);
95 95
(...skipping 15 matching lines...) Expand all
111 private: 111 private:
112 typedef GM INHERITED; 112 typedef GM INHERITED;
113 }; 113 };
114 114
115 /////////////////////////////////////////////////////////////////////////////// 115 ///////////////////////////////////////////////////////////////////////////////
116 116
117 static GM* MyFactory(void*) { return new VertTextGM; } 117 static GM* MyFactory(void*) { return new VertTextGM; }
118 static GMRegistry reg(MyFactory); 118 static GMRegistry reg(MyFactory);
119 119
120 } 120 }
OLDNEW
« no previous file with comments | « gm/vertices.cpp ('k') | gm/verttext2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698