OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 GrEffectUnitTest_DEFINED | 8 #ifndef GrEffectUnitTest_DEFINED |
9 #define GrEffectUnitTest_DEFINED | 9 #define GrEffectUnitTest_DEFINED |
10 | 10 |
11 #include "GrNoncopyable.h" | |
12 #include "SkRandom.h" | 11 #include "SkRandom.h" |
13 #include "SkTArray.h" | 12 #include "SkTArray.h" |
| 13 #include "SkTypes.h" |
14 | 14 |
15 class SkMatrix; | 15 class SkMatrix; |
16 class GrDrawTargetCaps; | 16 class GrDrawTargetCaps; |
17 | 17 |
18 namespace GrEffectUnitTest { | 18 namespace GrEffectUnitTest { |
19 // Used to access the dummy textures in TestCreate procs. | 19 // Used to access the dummy textures in TestCreate procs. |
20 enum { | 20 enum { |
21 kSkiaPMTextureIdx = 0, | 21 kSkiaPMTextureIdx = 0, |
22 kAlphaTextureIdx = 1, | 22 kAlphaTextureIdx = 1, |
23 }; | 23 }; |
24 | 24 |
25 /** | 25 /** |
26 * A helper for use in GrEffect::TestCreate functions. | 26 * A helper for use in GrEffect::TestCreate functions. |
27 */ | 27 */ |
28 const SkMatrix& TestMatrix(SkRandom*); | 28 const SkMatrix& TestMatrix(SkRandom*); |
29 | 29 |
30 } | 30 } |
31 | 31 |
32 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS | 32 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |
33 | 33 |
34 class GrContext; | 34 class GrContext; |
35 class GrEffectRef; | 35 class GrEffectRef; |
36 class GrTexture; | 36 class GrTexture; |
37 | 37 |
38 class GrEffectTestFactory : GrNoncopyable { | 38 class GrEffectTestFactory : public SkNoncopyable { |
39 public: | 39 public: |
40 | 40 |
41 typedef GrEffectRef* (*CreateProc)(SkRandom*, | 41 typedef GrEffectRef* (*CreateProc)(SkRandom*, |
42 GrContext*, | 42 GrContext*, |
43 const GrDrawTargetCaps& caps, | 43 const GrDrawTargetCaps& caps, |
44 GrTexture* dummyTextures[]); | 44 GrTexture* dummyTextures[]); |
45 | 45 |
46 GrEffectTestFactory(CreateProc createProc) { | 46 GrEffectTestFactory(CreateProc createProc) { |
47 fCreateProc = createProc; | 47 fCreateProc = createProc; |
48 GetFactories()->push_back(this); | 48 GetFactories()->push_back(this); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // its definitions will compile. | 92 // its definitions will compile. |
93 #define GR_DECLARE_EFFECT_TEST
\ | 93 #define GR_DECLARE_EFFECT_TEST
\ |
94 static GrEffectRef* TestCreate(SkRandom*,
\ | 94 static GrEffectRef* TestCreate(SkRandom*,
\ |
95 GrContext*,
\ | 95 GrContext*,
\ |
96 const GrDrawTargetCaps&,
\ | 96 const GrDrawTargetCaps&,
\ |
97 GrTexture* dummyTextures[2]) | 97 GrTexture* dummyTextures[2]) |
98 #define GR_DEFINE_EFFECT_TEST(X) | 98 #define GR_DEFINE_EFFECT_TEST(X) |
99 | 99 |
100 #endif // !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS | 100 #endif // !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |
101 #endif | 101 #endif |
OLD | NEW |