| 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 |
| 8 #include "gm.h" | 8 #include "gm.h" |
| 9 #include "SkAnimTimer.h" | 9 #include "SkAnimTimer.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| 11 #include "SkPath.h" | 11 #include "SkPath.h" |
| 12 | 12 |
| 13 // Reproduces https://code.google.com/p/chromium/issues/detail?id=279014 | 13 // Reproduces https://code.google.com/p/chromium/issues/detail?id=279014 |
| 14 | 14 |
| 15 static const int kWidth = 640; | 15 static const int kWidth = 440; |
| 16 static const int kHeight = 480; | 16 static const int kHeight = 440; |
| 17 static const SkScalar kAngle = 0.305f; | 17 static const SkScalar kAngle = 0.305f; |
| 18 static const int kMaxNumSteps = 140; | 18 static const int kMaxNumSteps = 140; |
| 19 | 19 |
| 20 // Renders a string art shape. | 20 // Renders a string art shape. |
| 21 // The particular shape rendered can be controlled by adjusting kAngle, from 0 t
o 1 | 21 // The particular shape rendered can be controlled by adjusting kAngle, from 0 t
o 1 |
| 22 | 22 |
| 23 class StringArtGM : public skiagm::GM { | 23 class StringArtGM : public skiagm::GM { |
| 24 public: | 24 public: |
| 25 StringArtGM() : fNumSteps(kMaxNumSteps) {} | 25 StringArtGM() : fNumSteps(kMaxNumSteps) {} |
| 26 | 26 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 return true; | 75 return true; |
| 76 } | 76 } |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 int fNumSteps; | 79 int fNumSteps; |
| 80 | 80 |
| 81 typedef GM INHERITED; | 81 typedef GM INHERITED; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 DEF_GM( return new StringArtGM; ) | 84 DEF_GM( return new StringArtGM; ) |
| OLD | NEW |