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

Side by Side Diff: samplecode/SampleChart.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/SampleArc.cpp ('k') | samplecode/SampleClock.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 "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // A set of scrolling line plots with the area between each plot filled. Stresse s out GPU path 81 // A set of scrolling line plots with the area between each plot filled. Stresse s out GPU path
82 // filling 82 // filling
83 class ChartView : public SampleView { 83 class ChartView : public SampleView {
84 public: 84 public:
85 ChartView() { 85 ChartView() {
86 fShift = 0; 86 fShift = 0;
87 fSize.set(-1, -1); 87 fSize.set(-1, -1);
88 } 88 }
89 89
90 protected: 90 protected:
91 virtual bool onQuery(SkEvent* evt) SK_OVERRIDE { 91 bool onQuery(SkEvent* evt) SK_OVERRIDE {
92 if (SampleCode::TitleQ(*evt)) { 92 if (SampleCode::TitleQ(*evt)) {
93 SampleCode::TitleR(evt, "Chart"); 93 SampleCode::TitleR(evt, "Chart");
94 return true; 94 return true;
95 } 95 }
96 return this->INHERITED::onQuery(evt); 96 return this->INHERITED::onQuery(evt);
97 } 97 }
98 98
99 virtual void onDrawContent(SkCanvas* canvas) SK_OVERRIDE { 99 void onDrawContent(SkCanvas* canvas) SK_OVERRIDE {
100 bool sizeChanged = false; 100 bool sizeChanged = false;
101 if (canvas->getDeviceSize() != fSize) { 101 if (canvas->getDeviceSize() != fSize) {
102 fSize = canvas->getDeviceSize(); 102 fSize = canvas->getDeviceSize();
103 sizeChanged = true; 103 sizeChanged = true;
104 } 104 }
105 105
106 SkScalar ySpread = SkIntToScalar(fSize.fHeight / 20); 106 SkScalar ySpread = SkIntToScalar(fSize.fHeight / 20);
107 107
108 SkScalar height = SkIntToScalar(fSize.fHeight); 108 SkScalar height = SkIntToScalar(fSize.fHeight);
109 109
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 int fShift; 175 int fShift;
176 SkISize fSize; 176 SkISize fSize;
177 SkTDArray<SkScalar> fData[kNumGraphs]; 177 SkTDArray<SkScalar> fData[kNumGraphs];
178 typedef SampleView INHERITED; 178 typedef SampleView INHERITED;
179 }; 179 };
180 180
181 ////////////////////////////////////////////////////////////////////////////// 181 //////////////////////////////////////////////////////////////////////////////
182 182
183 static SkView* MyFactory() { return new ChartView; } 183 static SkView* MyFactory() { return new ChartView; }
184 static SkViewRegister reg(MyFactory); 184 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleArc.cpp ('k') | samplecode/SampleClock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698