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