OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "gm.h" | 9 #include "gm.h" |
10 #include "SkPatchGrid.h" | 10 #include "SkPatchGrid.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 * This GM draws a grid of patches, it only uses colors so it could be considere
d a mesh gradient. | 57 * This GM draws a grid of patches, it only uses colors so it could be considere
d a mesh gradient. |
58 */ | 58 */ |
59 class SkPatchGridGM : public GM { | 59 class SkPatchGridGM : public GM { |
60 | 60 |
61 public: | 61 public: |
62 SkPatchGridGM() { | 62 SkPatchGridGM() { |
63 this->setBGColor(0xFFFFFFFF); | 63 this->setBGColor(0xFFFFFFFF); |
64 } | 64 } |
65 | 65 |
66 protected: | 66 protected: |
67 SkString onShortName() SK_OVERRIDE { | 67 SkString onShortName() override { |
68 return SkString("patch_grid"); | 68 return SkString("patch_grid"); |
69 } | 69 } |
70 | 70 |
71 SkISize onISize() SK_OVERRIDE { | 71 SkISize onISize() override { |
72 return SkISize::Make(800, 800); | 72 return SkISize::Make(800, 800); |
73 } | 73 } |
74 | 74 |
75 void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 75 void onDraw(SkCanvas* canvas) override { |
76 | 76 |
77 SkPaint paint; | 77 SkPaint paint; |
78 | 78 |
79 SkPoint vertices[4][5] = { | 79 SkPoint vertices[4][5] = { |
80 {{50,50}, {150,50}, {250,50},{350,50},{450,50}}, | 80 {{50,50}, {150,50}, {250,50},{350,50},{450,50}}, |
81 {{50,150}, {120,120}, {250,150},{350,150},{450,150}}, | 81 {{50,150}, {120,120}, {250,150},{350,150},{450,150}}, |
82 {{50,250}, {150,250}, {250,250},{350,250},{450,250}}, | 82 {{50,250}, {150,250}, {250,250},{350,250},{450,250}}, |
83 {{100,300}, {150,350}, {250,350},{350,350},{450,350}} | 83 {{100,300}, {150,350}, {250,350},{350,350},{450,350}} |
84 }; | 84 }; |
85 | 85 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 } | 152 } |
153 } | 153 } |
154 | 154 |
155 private: | 155 private: |
156 typedef GM INHERITED; | 156 typedef GM INHERITED; |
157 }; | 157 }; |
158 | 158 |
159 DEF_GM(return SkNEW(SkPatchGridGM); ) | 159 DEF_GM(return SkNEW(SkPatchGridGM); ) |
160 | 160 |
161 } | 161 } |
OLD | NEW |