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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkTArray.h" | 10 #include "SkTArray.h" |
11 | 11 |
12 namespace skiagm { | 12 namespace skiagm { |
13 | 13 |
14 class ConicPathsGM : public GM { | 14 class ConicPathsGM : public GM { |
15 protected: | 15 protected: |
16 | 16 |
17 virtual SkString onShortName() SK_OVERRIDE { | 17 virtual SkString onShortName() SK_OVERRIDE { |
18 return SkString("conicpaths"); | 18 return SkString("conicpaths"); |
19 } | 19 } |
20 | 20 |
21 virtual SkISize onISize() SK_OVERRIDE { | 21 virtual SkISize onISize() SK_OVERRIDE { |
22 return SkISize::Make(800, 600); | 22 return SkISize::Make(1000, 1000); |
23 } | 23 } |
24 | 24 |
25 virtual void onOnceBeforeDraw() SK_OVERRIDE { | 25 virtual void onOnceBeforeDraw() SK_OVERRIDE { |
26 { | 26 { |
27 SkPath* conicCirlce = &fPaths.push_back(); | 27 SkPath* conicCirlce = &fPaths.push_back(); |
28 conicCirlce->moveTo(0, -0); | 28 conicCirlce->moveTo(0, -0); |
29 conicCirlce->conicTo(SkIntToScalar(0), SkIntToScalar(50), | 29 conicCirlce->conicTo(SkIntToScalar(0), SkIntToScalar(50), |
30 SkIntToScalar(50), SkIntToScalar(50), | 30 SkIntToScalar(50), SkIntToScalar(50), |
31 SkScalarHalf(SkScalarSqrt(2))); | 31 SkScalarHalf(SkScalarSqrt(2))); |
32 conicCirlce->rConicTo(SkIntToScalar(50), SkIntToScalar(0), | 32 conicCirlce->rConicTo(SkIntToScalar(50), SkIntToScalar(0), |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 159 |
160 private: | 160 private: |
161 SkTArray<SkPath> fPaths; | 161 SkTArray<SkPath> fPaths; |
162 typedef GM INHERITED; | 162 typedef GM INHERITED; |
163 }; | 163 }; |
164 | 164 |
165 ////////////////////////////////////////////////////////////////////////////// | 165 ////////////////////////////////////////////////////////////////////////////// |
166 | 166 |
167 DEF_GM( return SkNEW(ConicPathsGM); ) | 167 DEF_GM( return SkNEW(ConicPathsGM); ) |
168 } | 168 } |
OLD | NEW |