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

Side by Side Diff: samplecode/SampleLayers.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 | « samplecode/SampleIdentityScale.cpp ('k') | samplecode/SampleLines.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 /* 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 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 canvas->drawRect(r, paint); 116 canvas->drawRect(r, paint);
117 117
118 r.fTop = SkIntToScalar(80); 118 r.fTop = SkIntToScalar(80);
119 r.fBottom = SkIntToScalar(100); 119 r.fBottom = SkIntToScalar(100);
120 // SkDebugf("--------- draw bot grad\n"); 120 // SkDebugf("--------- draw bot grad\n");
121 canvas->drawRect(r, paint); 121 canvas->drawRect(r, paint);
122 } 122 }
123 123
124 class RedFilter : public SkDrawFilter { 124 class RedFilter : public SkDrawFilter {
125 public: 125 public:
126 bool filter(SkPaint* p, SkDrawFilter::Type) SK_OVERRIDE { 126 bool filter(SkPaint* p, SkDrawFilter::Type) override {
127 fColor = p->getColor(); 127 fColor = p->getColor();
128 if (fColor == SK_ColorRED) { 128 if (fColor == SK_ColorRED) {
129 p->setColor(SK_ColorGREEN); 129 p->setColor(SK_ColorGREEN);
130 } 130 }
131 return true; 131 return true;
132 } 132 }
133 133
134 private: 134 private:
135 SkColor fColor; 135 SkColor fColor;
136 }; 136 };
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 p.setColor(SK_ColorBLUE); 208 p.setColor(SK_ColorBLUE);
209 canvas->drawOval(r, p); 209 canvas->drawOval(r, p);
210 canvas->restore(); 210 canvas->restore();
211 return; 211 return;
212 } 212 }
213 213
214 test_fade(canvas); 214 test_fade(canvas);
215 } 215 }
216 216
217 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, 217 virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y,
218 unsigned modi) SK_OVERRIDE { 218 unsigned modi) override {
219 this->inval(NULL); 219 this->inval(NULL);
220 220
221 return this->INHERITED::onFindClickHandler(x, y, modi); 221 return this->INHERITED::onFindClickHandler(x, y, modi);
222 } 222 }
223 223
224 virtual bool onClick(Click* click) { 224 virtual bool onClick(Click* click) {
225 return this->INHERITED::onClick(click); 225 return this->INHERITED::onClick(click);
226 } 226 }
227 227
228 virtual bool handleKey(SkKey) { 228 virtual bool handleKey(SkKey) {
229 this->inval(NULL); 229 this->inval(NULL);
230 return true; 230 return true;
231 } 231 }
232 232
233 private: 233 private:
234 typedef SkView INHERITED; 234 typedef SkView INHERITED;
235 }; 235 };
236 236
237 ////////////////////////////////////////////////////////////////////////////// 237 //////////////////////////////////////////////////////////////////////////////
238 238
239 static SkView* MyFactory() { return new LayersView; } 239 static SkView* MyFactory() { return new LayersView; }
240 static SkViewRegister reg(MyFactory); 240 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleIdentityScale.cpp ('k') | samplecode/SampleLines.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698