OLD | NEW |
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 #include "SampleCode.h" | 8 #include "SampleCode.h" |
8 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkPath.h" |
9 | 11 |
10 // Reproduces https://code.google.com/p/chromium/issues/detail?id=279014 | 12 // Reproduces https://code.google.com/p/chromium/issues/detail?id=279014 |
11 | 13 |
12 // Renders a string art shape. | 14 // Renders a string art shape. |
13 // The particular shape rendered can be controlled by clicking horizontally, the
reby | 15 // The particular shape rendered can be controlled by clicking horizontally, the
reby |
14 // generating an angle from 0 to 1. | 16 // generating an angle from 0 to 1. |
15 | 17 |
16 class StringArtView : public SampleView { | 18 class StringArtView : public SampleView { |
17 public: | 19 public: |
18 StringArtView() : fAngle(0.305f) {} | 20 StringArtView() : fAngle(0.305f) {} |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 private: | 65 private: |
64 | 66 |
65 SkScalar fAngle; | 67 SkScalar fAngle; |
66 typedef SampleView INHERITED; | 68 typedef SampleView INHERITED; |
67 }; | 69 }; |
68 | 70 |
69 ////////////////////////////////////////////////////////////////////////////// | 71 ////////////////////////////////////////////////////////////////////////////// |
70 | 72 |
71 static SkView* MyFactory() { return new StringArtView; } | 73 static SkView* MyFactory() { return new StringArtView; } |
72 static SkViewRegister reg(MyFactory); | 74 static SkViewRegister reg(MyFactory); |
OLD | NEW |