| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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); |
| OLD | NEW |