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

Side by Side Diff: gm/vertices.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, 9 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/variedtext.cpp ('k') | gm/verttext.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 "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 21 matching lines...) Expand all
32 public: 32 public:
33 VerticesGM(unsigned alpha) : fShader(NULL), fAlpha(alpha) { 33 VerticesGM(unsigned alpha) : fShader(NULL), fAlpha(alpha) {
34 } 34 }
35 35
36 virtual ~VerticesGM() { 36 virtual ~VerticesGM() {
37 SkSafeUnref(fShader); 37 SkSafeUnref(fShader);
38 } 38 }
39 39
40 protected: 40 protected:
41 41
42 void onOnceBeforeDraw() SK_OVERRIDE { 42 void onOnceBeforeDraw() override {
43 const SkScalar X = 150; 43 const SkScalar X = 150;
44 const SkScalar Y = 150; 44 const SkScalar Y = 150;
45 45
46 fPts[0].set(0, 0); fPts[1].set(X/2, 10); fPts[2].set(X, 0); 46 fPts[0].set(0, 0); fPts[1].set(X/2, 10); fPts[2].set(X, 0);
47 fPts[3].set(10, Y/2); fPts[4].set(X/2, Y/2); fPts[5].set(X-10, Y/2); 47 fPts[3].set(10, Y/2); fPts[4].set(X/2, Y/2); fPts[5].set(X-10, Y/2);
48 fPts[6].set(0, Y); fPts[7].set(X/2, Y-10); fPts[8].set(X, Y); 48 fPts[6].set(0, Y); fPts[7].set(X/2, Y-10); fPts[8].set(X, Y);
49 49
50 const SkScalar w = 200; 50 const SkScalar w = 200;
51 const SkScalar h = 200; 51 const SkScalar h = 200;
52 52
53 fTexs[0].set(0, 0); fTexs[1].set(w/2, 0); fTexs[2].set(w, 0); 53 fTexs[0].set(0, 0); fTexs[1].set(w/2, 0); fTexs[2].set(w, 0);
54 fTexs[3].set(0, h/2); fTexs[4].set(w/2, h/2); fTexs[5].set(w, h/2); 54 fTexs[3].set(0, h/2); fTexs[4].set(w/2, h/2); fTexs[5].set(w, h/2);
55 fTexs[6].set(0, h); fTexs[7].set(w/2, h); fTexs[8].set(w, h); 55 fTexs[6].set(0, h); fTexs[7].set(w/2, h); fTexs[8].set(w, h);
56 56
57 fShader = make_shader(w, h); 57 fShader = make_shader(w, h);
58 58
59 SkRandom rand; 59 SkRandom rand;
60 for (size_t i = 0; i < SK_ARRAY_COUNT(fColors); ++i) { 60 for (size_t i = 0; i < SK_ARRAY_COUNT(fColors); ++i) {
61 fColors[i] = rand.nextU() | 0xFF000000; 61 fColors[i] = rand.nextU() | 0xFF000000;
62 } 62 }
63 } 63 }
64 64
65 SkString onShortName() SK_OVERRIDE { 65 SkString onShortName() override {
66 SkString name("vertices"); 66 SkString name("vertices");
67 if (0xFF != fAlpha) { 67 if (0xFF != fAlpha) {
68 name.appendf("_%02X", fAlpha); 68 name.appendf("_%02X", fAlpha);
69 } 69 }
70 return name; 70 return name;
71 } 71 }
72 72
73 SkISize onISize() SK_OVERRIDE { 73 SkISize onISize() override {
74 return SkISize::Make(600, 600); 74 return SkISize::Make(600, 600);
75 } 75 }
76 76
77 void onDraw(SkCanvas* canvas) SK_OVERRIDE { 77 void onDraw(SkCanvas* canvas) override {
78 // start with the center of a 3x3 grid 78 // start with the center of a 3x3 grid
79 static const uint16_t fan[] = { 79 static const uint16_t fan[] = {
80 4, 80 4,
81 0, 1, 2, 5, 8, 7, 6, 3, 0 81 0, 1, 2, 5, 8, 7, 6, 3, 0
82 }; 82 };
83 83
84 const struct { 84 const struct {
85 const SkColor* fColors; 85 const SkColor* fColors;
86 const SkPoint* fTexs; 86 const SkPoint* fTexs;
87 } rec[] = { 87 } rec[] = {
(...skipping 30 matching lines...) Expand all
118 } 118 }
119 119
120 private: 120 private:
121 typedef skiagm::GM INHERITED; 121 typedef skiagm::GM INHERITED;
122 }; 122 };
123 123
124 //////////////////////////////////////////////////////////////////////////////// ///// 124 //////////////////////////////////////////////////////////////////////////////// /////
125 125
126 DEF_GM( return SkNEW_ARGS(VerticesGM, (0xFF)); ) 126 DEF_GM( return SkNEW_ARGS(VerticesGM, (0xFF)); )
127 DEF_GM( return SkNEW_ARGS(VerticesGM, (0x80)); ) 127 DEF_GM( return SkNEW_ARGS(VerticesGM, (0x80)); )
OLDNEW
« no previous file with comments | « gm/variedtext.cpp ('k') | gm/verttext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698