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 virtual SkString onShortName() SK_OVERRIDE { | 67 SkString onShortName() SK_OVERRIDE { |
68 return SkString("patch_grid"); | 68 return SkString("patch_grid"); |
69 } | 69 } |
70 | 70 |
71 virtual SkISize onISize() SK_OVERRIDE { | 71 SkISize onISize() SK_OVERRIDE { |
72 return SkISize::Make(800, 800); | 72 return SkISize::Make(800, 800); |
73 } | 73 } |
74 | 74 |
75 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 75 uint32_t onGetFlags() const SK_OVERRIDE { |
76 return kSkipTiled_Flag; | 76 return kSkipTiled_Flag; |
77 } | 77 } |
78 | 78 |
79 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 79 void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
80 | 80 |
81 SkPaint paint; | 81 SkPaint paint; |
82 | 82 |
83 SkPoint vertices[4][5] = { | 83 SkPoint vertices[4][5] = { |
84 {{50,50}, {150,50}, {250,50},{350,50},{450,50}}, | 84 {{50,50}, {150,50}, {250,50},{350,50},{450,50}}, |
85 {{50,150}, {120,120}, {250,150},{350,150},{450,150}}, | 85 {{50,150}, {120,120}, {250,150},{350,150},{450,150}}, |
86 {{50,250}, {150,250}, {250,250},{350,250},{450,250}}, | 86 {{50,250}, {150,250}, {250,250},{350,250},{450,250}}, |
87 {{100,300}, {150,350}, {250,350},{350,350},{450,350}} | 87 {{100,300}, {150,350}, {250,350},{350,350},{450,350}} |
88 }; | 88 }; |
89 | 89 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 } | 157 } |
158 | 158 |
159 private: | 159 private: |
160 typedef GM INHERITED; | 160 typedef GM INHERITED; |
161 }; | 161 }; |
162 | 162 |
163 DEF_GM(return SkNEW(SkPatchGridGM); ) | 163 DEF_GM(return SkNEW(SkPatchGridGM); ) |
164 | 164 |
165 } | 165 } |
OLD | NEW |