OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SampleCode.h" | 9 #include "SampleCode.h" |
10 #include "SkRandom.h" | 10 #include "SkRandom.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 fCurRandRect, | 120 fCurRandRect, |
121 kNumRandRects); | 121 kNumRandRects); |
122 canvas->drawText(str.c_str(), str.size(), 50, kHeight + 50, blackBigFont
); | 122 canvas->drawText(str.c_str(), str.size(), 50, kHeight + 50, blackBigFont
); |
123 | 123 |
124 str.printf("Press \'j\' to toggle rectanizer"); | 124 str.printf("Press \'j\' to toggle rectanizer"); |
125 canvas->drawText(str.c_str(), str.size(), 50, kHeight + 100, blackBigFon
t); | 125 canvas->drawText(str.c_str(), str.size(), 50, kHeight + 100, blackBigFon
t); |
126 | 126 |
127 str.printf("Press \'h\' to toggle rects"); | 127 str.printf("Press \'h\' to toggle rects"); |
128 canvas->drawText(str.c_str(), str.size(), 50, kHeight + 150, blackBigFon
t); | 128 canvas->drawText(str.c_str(), str.size(), 50, kHeight + 150, blackBigFon
t); |
129 | 129 |
130 this->inval(NULL); | 130 this->inval(nullptr); |
131 } | 131 } |
132 | 132 |
133 private: | 133 private: |
134 static const int kWidth = 1024; | 134 static const int kWidth = 1024; |
135 static const int kHeight = 1024; | 135 static const int kHeight = 1024; |
136 static const int kNumRandRects = 200; | 136 static const int kNumRandRects = 200; |
137 static const char kCycleRectanizerKey = 'j'; | 137 static const char kCycleRectanizerKey = 'j'; |
138 static const char kCycleRectsKey = 'h'; | 138 static const char kCycleRectsKey = 'h'; |
139 static const int kMinRectSize = 2; | 139 static const int kMinRectSize = 2; |
140 static const int kMaxRectSize = 256; | 140 static const int kMaxRectSize = 256; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 189 } |
190 | 190 |
191 typedef SampleView INHERITED; | 191 typedef SampleView INHERITED; |
192 }; | 192 }; |
193 | 193 |
194 ////////////////////////////////////////////////////////////////////////////// | 194 ////////////////////////////////////////////////////////////////////////////// |
195 static SkView* MyFactory() { return new RectanizerView; } | 195 static SkView* MyFactory() { return new RectanizerView; } |
196 static SkViewRegister reg(MyFactory); | 196 static SkViewRegister reg(MyFactory); |
197 | 197 |
198 #endif | 198 #endif |
OLD | NEW |