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

Side by Side Diff: samplecode/SampleLines.cpp

Issue 1232463006: Fix up -Winconsistent-missing-override (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: llvm_coverage_build Created 5 years, 5 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/SampleLayers.cpp ('k') | samplecode/SampleManyRects.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 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkView.h" 9 #include "SkView.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 16 matching lines...) Expand all
27 #include "SkXMLParser.h" 27 #include "SkXMLParser.h"
28 #include "SkColorPriv.h" 28 #include "SkColorPriv.h"
29 #include "SkImageDecoder.h" 29 #include "SkImageDecoder.h"
30 30
31 class LinesView : public SampleView { 31 class LinesView : public SampleView {
32 public: 32 public:
33 LinesView() {} 33 LinesView() {}
34 34
35 protected: 35 protected:
36 // overrides from SkEventSink 36 // overrides from SkEventSink
37 virtual bool onQuery(SkEvent* evt) { 37 bool onQuery(SkEvent* evt) override {
38 if (SampleCode::TitleQ(*evt)) { 38 if (SampleCode::TitleQ(*evt)) {
39 SampleCode::TitleR(evt, "Lines"); 39 SampleCode::TitleR(evt, "Lines");
40 return true; 40 return true;
41 } 41 }
42 return this->INHERITED::onQuery(evt); 42 return this->INHERITED::onQuery(evt);
43 } 43 }
44 44
45 /* 45 /*
46 0x1F * x + 0x1F * (32 - x) 46 0x1F * x + 0x1F * (32 - x)
47 */ 47 */
48 void drawRings(SkCanvas* canvas) { 48 void drawRings(SkCanvas* canvas) {
49 canvas->scale(SkIntToScalar(1)/2, SkIntToScalar(1)/2); 49 canvas->scale(SkIntToScalar(1)/2, SkIntToScalar(1)/2);
50 50
51 SkRect r; 51 SkRect r;
52 SkScalar x = SkIntToScalar(10); 52 SkScalar x = SkIntToScalar(10);
53 SkScalar y = SkIntToScalar(10); 53 SkScalar y = SkIntToScalar(10);
54 r.set(x, y, x + SkIntToScalar(100), y + SkIntToScalar(100)); 54 r.set(x, y, x + SkIntToScalar(100), y + SkIntToScalar(100));
55 55
56 SkPaint paint; 56 SkPaint paint;
57 // paint.setAntiAlias(true); 57 // paint.setAntiAlias(true);
58 paint.setStyle(SkPaint::kStroke_Style); 58 paint.setStyle(SkPaint::kStroke_Style);
59 paint.setStrokeWidth(SkScalarHalf(SkIntToScalar(3))); 59 paint.setStrokeWidth(SkScalarHalf(SkIntToScalar(3)));
60 paint.setColor(0xFFFF8800); 60 paint.setColor(0xFFFF8800);
61 // paint.setColor(0xFFFFFFFF); 61 // paint.setColor(0xFFFFFFFF);
62 canvas->drawRect(r, paint); 62 canvas->drawRect(r, paint);
63 } 63 }
64 64
65 virtual void onDrawContent(SkCanvas* canvas) { 65 void onDrawContent(SkCanvas* canvas) override {
66 SkBitmap bm; 66 SkBitmap bm;
67 SkImageDecoder::DecodeFile("/kill.gif", &bm); 67 SkImageDecoder::DecodeFile("/kill.gif", &bm);
68 canvas->drawBitmap(bm, 0, 0, NULL); 68 canvas->drawBitmap(bm, 0, 0, NULL);
69 69
70 this->drawRings(canvas); 70 this->drawRings(canvas);
71 return; 71 return;
72 72
73 SkPaint paint; 73 SkPaint paint;
74 74
75 // fAlpha = 0x80; 75 // fAlpha = 0x80;
(...skipping 28 matching lines...) Expand all
104 private: 104 private:
105 105
106 int fAlpha; 106 int fAlpha;
107 typedef SampleView INHERITED; 107 typedef SampleView INHERITED;
108 }; 108 };
109 109
110 ////////////////////////////////////////////////////////////////////////////// 110 //////////////////////////////////////////////////////////////////////////////
111 111
112 static SkView* MyFactory() { return new LinesView; } 112 static SkView* MyFactory() { return new LinesView; }
113 static SkViewRegister reg(MyFactory); 113 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleLayers.cpp ('k') | samplecode/SampleManyRects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698