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

Side by Side Diff: samplecode/SampleLayers.cpp

Issue 806653007: Fix up all the easy virtual ... SK_OVERRIDE cases. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 11 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 virtual bool filter(SkPaint* p, SkDrawFilter::Type) SK_OVERRIDE { 126 bool filter(SkPaint* p, SkDrawFilter::Type) SK_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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
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