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