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

Side by Side Diff: samplecode/SampleArc.cpp

Issue 727363003: wip for drawables (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make the pictures in the array also const (the array already was const) Created 6 years, 1 month 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 | « include/core/SkPicture.h ('k') | src/core/SkCanvas.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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 canvas->drawArc(fR, 0, fSweep, false, paint); 65 canvas->drawArc(fR, 0, fSweep, false, paint);
66 66
67 paint.setStyle(SkPaint::kStroke_Style); 67 paint.setStyle(SkPaint::kStroke_Style);
68 paint.setColor(SK_ColorRED); 68 paint.setColor(SK_ColorRED);
69 canvas->drawArc(fR, 0, fSweep, true, paint); 69 canvas->drawArc(fR, 0, fSweep, true, paint);
70 70
71 paint.setStrokeWidth(0); 71 paint.setStrokeWidth(0);
72 paint.setColor(SK_ColorBLUE); 72 paint.setColor(SK_ColorBLUE);
73 canvas->drawArc(fR, 0, fSweep, false, paint); 73 canvas->drawArc(fR, 0, fSweep, false, paint);
74 } 74 }
75
76 SkRect onGetBounds() SK_OVERRIDE {
77 SkRect r(fR);
78 r.outset(2, 2);
79 return r;
80 }
75 }; 81 };
76 82
77 public: 83 public:
78 SkRect fRect; 84 SkRect fRect;
79 MyDrawable* fDrawable; 85 MyDrawable* fDrawable;
80 86
81 ArcsView() { 87 ArcsView() {
82 testparse(); 88 testparse();
83 fSweep = SkIntToScalar(100); 89 fSweep = SkIntToScalar(100);
84 this->setBGColor(0xFFDDDDDD); 90 this->setBGColor(0xFFDDDDDD);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 private: 206 private:
201 SkScalar fSweep; 207 SkScalar fSweep;
202 208
203 typedef SampleView INHERITED; 209 typedef SampleView INHERITED;
204 }; 210 };
205 211
206 ////////////////////////////////////////////////////////////////////////////// 212 //////////////////////////////////////////////////////////////////////////////
207 213
208 static SkView* MyFactory() { return new ArcsView; } 214 static SkView* MyFactory() { return new ArcsView; }
209 static SkViewRegister reg(MyFactory); 215 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « include/core/SkPicture.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698