OLD | NEW |
---|---|
1 | 1 |
epoger
2013/05/09 18:26:01
Patchset 1 just applies the diffs from https://cod
| |
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 #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 "SkDevice.h" | 13 #include "SkDevice.h" |
14 #include "SkPaint.h" | 14 #include "SkPaint.h" |
15 #include "SkSize.h" | 15 #include "SkSize.h" |
16 #include "SkString.h" | 16 #include "SkString.h" |
17 #include "SkTRegistry.h" | 17 #include "SkTRegistry.h" |
18 | 18 |
19 #define DEF_GM(code) \ | 19 #define DEF_GM(code) \ |
20 static skiagm::GM* SK_MACRO_APPEND_LINE(F_)(void*) { code; } \ | 20 static skiagm::GM* SK_MACRO_APPEND_LINE(F_)(void*) { code; } \ |
21 static skiagm::GMRegistry SK_MACRO_APPEND_LINE(R_)(SK_MACRO_APPEND_LINE(F_ )); | 21 static skiagm::GMRegistry SK_MACRO_APPEND_LINE(R_)(SK_MACRO_APPEND_LINE(F_ )); |
22 | 22 |
23 namespace skiagm { | 23 namespace skiagm { |
24 | 24 |
25 // TODO(epoger): Right now, various places in the code assume that all the | |
26 // image files read/written by GM use this file extension. | |
27 // Search for references to this constant to find these assumptions. | |
28 const static char kPNG_FileExtension[] = "png"; | |
29 | |
25 static inline SkISize make_isize(int w, int h) { | 30 static inline SkISize make_isize(int w, int h) { |
26 SkISize sz; | 31 SkISize sz; |
27 sz.set(w, h); | 32 sz.set(w, h); |
28 return sz; | 33 return sz; |
29 } | 34 } |
30 | 35 |
31 class GM { | 36 class GM { |
32 public: | 37 public: |
33 GM(); | 38 GM(); |
34 virtual ~GM(); | 39 virtual ~GM(); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 SkString fShortName; | 105 SkString fShortName; |
101 SkColor fBGColor; | 106 SkColor fBGColor; |
102 bool fCanvasIsDeferred; // work-around problem in srcmode.cpp | 107 bool fCanvasIsDeferred; // work-around problem in srcmode.cpp |
103 bool fHaveCalledOnceBeforeDraw; | 108 bool fHaveCalledOnceBeforeDraw; |
104 }; | 109 }; |
105 | 110 |
106 typedef SkTRegistry<GM*, void*> GMRegistry; | 111 typedef SkTRegistry<GM*, void*> GMRegistry; |
107 } | 112 } |
108 | 113 |
109 #endif | 114 #endif |
OLD | NEW |