OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #ifndef skiagm_DEFINED | 8 #ifndef skiagm_DEFINED |
9 #define skiagm_DEFINED | 9 #define skiagm_DEFINED |
10 | 10 |
11 #include "SkBitmap.h" | 11 #include "SkBitmap.h" |
12 #include "SkCanvas.h" | 12 #include "SkCanvas.h" |
13 #include "SkPaint.h" | 13 #include "SkPaint.h" |
14 #include "SkSize.h" | 14 #include "SkSize.h" |
15 #include "SkString.h" | 15 #include "SkString.h" |
16 #include "SkTRegistry.h" | 16 #include "SkTRegistry.h" |
17 #include "sk_tool_utils.h" | 17 #include "sk_tool_utils.h" |
18 | 18 |
19 class SkAnimTimer; | 19 class SkAnimTimer; |
20 struct GrContextOptions; | 20 struct GrContextOptions; |
21 | 21 |
22 #define DEF_GM(code) \ | 22 #define DEF_GM(code) \ |
23 static skiagm::GM* SK_MACRO_APPEND_LINE(F_)(void*) { code; } \ | 23 static skiagm::GM* SK_MACRO_APPEND_LINE(F_)(void*) { code; } \ |
24 static skiagm::GMRegistry SK_MACRO_APPEND_LINE(R_)(SK_MACRO_APPEND_LINE(F_
)); | 24 static skiagm::GMRegistry SK_MACRO_APPEND_LINE(R_)(SK_MACRO_APPEND_LINE(F_
)); |
25 | 25 |
26 // See colorwheel.cpp for example usage. | 26 // See colorwheel.cpp for example usage. |
27 #define DEF_SIMPLE_GM(NAME, CANVAS, W, H) \ | 27 #define DEF_SIMPLE_GM(NAME, CANVAS, W, H)
\ |
28 static void SK_MACRO_CONCAT(NAME, _GM)(SkCanvas* CANVAS); \ | 28 static void SK_MACRO_CONCAT(NAME, _GM)(SkCanvas * CANVAS);
\ |
29 DEF_GM( return SkNEW_ARGS(skiagm::SimpleGM, \ | 29 DEF_GM(return new skiagm::SimpleGM(SkString(#NAME), SK_MACRO_CONCAT(NAME, _G
M), \ |
30 (SkString(#NAME), \ | 30 SkISize::Make(W, H));)
\ |
31 SK_MACRO_CONCAT(NAME, _GM), \ | 31 void SK_MACRO_CONCAT(NAME, _GM)(SkCanvas * CANVAS) |
32 SkISize::Make(W, H))); ) \ | |
33 void SK_MACRO_CONCAT(NAME, _GM)(SkCanvas* CANVAS) | |
34 | 32 |
35 namespace skiagm { | 33 namespace skiagm { |
36 | 34 |
37 class GM { | 35 class GM { |
38 public: | 36 public: |
39 GM(); | 37 GM(); |
40 virtual ~GM(); | 38 virtual ~GM(); |
41 | 39 |
42 enum Mode { | 40 enum Mode { |
43 kGM_Mode, | 41 kGM_Mode, |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 SkISize onISize() override; | 127 SkISize onISize() override; |
130 SkString onShortName() override; | 128 SkString onShortName() override; |
131 private: | 129 private: |
132 SkString fName; | 130 SkString fName; |
133 void (*fDrawProc)(SkCanvas*); | 131 void (*fDrawProc)(SkCanvas*); |
134 SkISize fSize; | 132 SkISize fSize; |
135 }; | 133 }; |
136 } | 134 } |
137 | 135 |
138 #endif | 136 #endif |
OLD | NEW |