OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #include "gm.h" | 8 #include "gm.h" |
9 | 9 |
10 namespace skiagm { | 10 namespace skiagm { |
11 | 11 |
12 static const char* gColorTypeNames[] = { | 12 static const char* gColorTypeNames[] = { |
13 "unknown", | 13 "unknown", |
14 "A8", | 14 "A8", |
15 "565", | 15 "565", |
16 "4444", | 16 "4444", |
17 "8888", | 17 "8888", |
18 "8888", | 18 "8888", |
19 "Index8", | 19 "Index8", |
20 }; | 20 }; |
21 | 21 |
22 static const SkColorType gColorTypes[] = { | 22 static const SkColorType gColorTypes[] = { |
23 kRGB_565_SkColorType, | 23 kRGB_565_SkColorType, |
24 kARGB_4444_SkColorType, | 24 kARGB_4444_SkColorType, |
25 kN32_SkColorType, | 25 kPMColor_SkColorType, |
26 }; | 26 }; |
27 | 27 |
28 #define NUM_CONFIGS SK_ARRAY_COUNT(gColorTypes) | 28 #define NUM_CONFIGS SK_ARRAY_COUNT(gColorTypes) |
29 | 29 |
30 static void draw_checks(SkCanvas* canvas, int width, int height) { | 30 static void draw_checks(SkCanvas* canvas, int width, int height) { |
31 SkPaint paint; | 31 SkPaint paint; |
32 paint.setColor(SK_ColorRED); | 32 paint.setColor(SK_ColorRED); |
33 canvas->drawRectCoords(SkIntToScalar(0), SkIntToScalar(0), | 33 canvas->drawRectCoords(SkIntToScalar(0), SkIntToScalar(0), |
34 SkIntToScalar(width / 2), SkIntToScalar(height / 2), paint); | 34 SkIntToScalar(width / 2), SkIntToScalar(height / 2), paint); |
35 paint.setColor(SK_ColorGREEN); | 35 paint.setColor(SK_ColorGREEN); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 private: | 118 private: |
119 typedef GM INHERITED; | 119 typedef GM INHERITED; |
120 }; | 120 }; |
121 | 121 |
122 ////////////////////////////////////////////////////////////////////////////// | 122 ////////////////////////////////////////////////////////////////////////////// |
123 | 123 |
124 static GM* MyFactory(void*) { return new BitmapCopyGM; } | 124 static GM* MyFactory(void*) { return new BitmapCopyGM; } |
125 static GMRegistry reg(MyFactory); | 125 static GMRegistry reg(MyFactory); |
126 } | 126 } |
OLD | NEW |