OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkCullPoints.h" | 10 #include "SkCullPoints.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 } | 28 } |
29 } | 29 } |
30 } | 30 } |
31 | 31 |
32 class HitTestPathGM : public skiagm::GM { | 32 class HitTestPathGM : public skiagm::GM { |
33 public: | 33 public: |
34 HitTestPathGM () {} | 34 HitTestPathGM () {} |
35 | 35 |
36 protected: | 36 protected: |
37 | 37 |
38 SkString onShortName() SK_OVERRIDE { | 38 SkString onShortName() override { |
39 return SkString("hittestpath"); | 39 return SkString("hittestpath"); |
40 } | 40 } |
41 | 41 |
42 SkISize onISize() SK_OVERRIDE { return SkISize::Make(700, 460); } | 42 SkISize onISize() override { return SkISize::Make(700, 460); } |
43 | 43 |
44 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 44 void onDraw(SkCanvas* canvas) override { |
45 SkPath path; | 45 SkPath path; |
46 SkRandom rand; | 46 SkRandom rand; |
47 | 47 |
48 int scale = 300; | 48 int scale = 300; |
49 for (int i = 0; i < 4; ++i) { | 49 for (int i = 0; i < 4; ++i) { |
50 path.lineTo(rand.nextUScalar1() * scale, rand.nextUScalar1() * scale
); | 50 path.lineTo(rand.nextUScalar1() * scale, rand.nextUScalar1() * scale
); |
51 path.quadTo(rand.nextUScalar1() * scale, rand.nextUScalar1() * scale
, | 51 path.quadTo(rand.nextUScalar1() * scale, rand.nextUScalar1() * scale
, |
52 rand.nextUScalar1() * scale, rand.nextUScalar1() * scale
); | 52 rand.nextUScalar1() * scale, rand.nextUScalar1() * scale
); |
53 path.cubicTo(rand.nextUScalar1() * scale, rand.nextUScalar1() * scal
e, | 53 path.cubicTo(rand.nextUScalar1() * scale, rand.nextUScalar1() * scal
e, |
54 rand.nextUScalar1() * scale, rand.nextUScalar1() * scal
e, | 54 rand.nextUScalar1() * scale, rand.nextUScalar1() * scal
e, |
(...skipping 12 matching lines...) Expand all Loading... |
67 } | 67 } |
68 | 68 |
69 private: | 69 private: |
70 typedef GM INHERITED; | 70 typedef GM INHERITED; |
71 }; | 71 }; |
72 | 72 |
73 ////////////////////////////////////////////////////////////////////////////// | 73 ////////////////////////////////////////////////////////////////////////////// |
74 | 74 |
75 static skiagm::GM* MyFactory(void*) { return new HitTestPathGM; } | 75 static skiagm::GM* MyFactory(void*) { return new HitTestPathGM; } |
76 static skiagm::GMRegistry reg(MyFactory); | 76 static skiagm::GMRegistry reg(MyFactory); |
OLD | NEW |