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 GrProcessorUnitTest_DEFINED | 8 #ifndef GrProcessorUnitTest_DEFINED |
9 #define GrProcessorUnitTest_DEFINED | 9 #define GrProcessorUnitTest_DEFINED |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 /* | 34 /* |
35 * GrProcessorTestData is an argument struct to TestCreate functions | 35 * GrProcessorTestData is an argument struct to TestCreate functions |
36 * fTextures are valid textures that can optionally be used to construct | 36 * fTextures are valid textures that can optionally be used to construct |
37 * GrTextureAccesses. The first texture has config kSkia8888_GrPixelConfig and t
he second has | 37 * GrTextureAccesses. The first texture has config kSkia8888_GrPixelConfig and t
he second has |
38 * kAlpha_8_GrPixelConfig. TestCreate functions are also free to create addition
al textures using | 38 * kAlpha_8_GrPixelConfig. TestCreate functions are also free to create addition
al textures using |
39 * the GrContext. | 39 * the GrContext. |
40 */ | 40 */ |
41 struct GrProcessorTestData { | 41 struct GrProcessorTestData { |
42 GrProcessorTestData(SkRandom* random, | 42 GrProcessorTestData(SkRandom* random, |
43 GrContext* context, | 43 GrContext* context, |
44 GrProcessorDataManager* procDataManager, | |
45 const GrCaps* caps, | 44 const GrCaps* caps, |
46 GrTexture* textures[2]) | 45 GrTexture* textures[2]) |
47 : fRandom(random) | 46 : fRandom(random) |
48 , fContext(context) | 47 , fContext(context) |
49 , fProcDataManager(procDataManager) | |
50 , fCaps(caps) { | 48 , fCaps(caps) { |
51 fTextures[0] = textures[0]; | 49 fTextures[0] = textures[0]; |
52 fTextures[1] = textures[1]; | 50 fTextures[1] = textures[1]; |
53 } | 51 } |
54 SkRandom* fRandom; | 52 SkRandom* fRandom; |
55 GrContext* fContext; | 53 GrContext* fContext; |
56 GrProcessorDataManager* fProcDataManager; | |
57 const GrCaps* fCaps; | 54 const GrCaps* fCaps; |
58 GrTexture* fTextures[2]; | 55 GrTexture* fTextures[2]; |
59 }; | 56 }; |
60 | 57 |
61 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS | 58 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |
62 | 59 |
63 class GrProcessor; | 60 class GrProcessor; |
64 class GrTexture; | 61 class GrTexture; |
65 | 62 |
66 template <class Processor> class GrProcessorTestFactory : SkNoncopyable { | 63 template <class Processor> class GrProcessorTestFactory : SkNoncopyable { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 #define GR_DEFINE_XP_FACTORY_TEST(X) | 140 #define GR_DEFINE_XP_FACTORY_TEST(X) |
144 | 141 |
145 // The unit test relies on static initializers. Just declare the TestCreate func
tion so that | 142 // The unit test relies on static initializers. Just declare the TestCreate func
tion so that |
146 // its definitions will compile. | 143 // its definitions will compile. |
147 #define GR_DECLARE_GEOMETRY_PROCESSOR_TEST
\ | 144 #define GR_DECLARE_GEOMETRY_PROCESSOR_TEST
\ |
148 static const GrGeometryProcessor* TestCreate(GrProcessorTestData*) | 145 static const GrGeometryProcessor* TestCreate(GrProcessorTestData*) |
149 #define GR_DEFINE_GEOMETRY_PROCESSOR_TEST(X) | 146 #define GR_DEFINE_GEOMETRY_PROCESSOR_TEST(X) |
150 | 147 |
151 #endif // !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS | 148 #endif // !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |
152 #endif | 149 #endif |
OLD | NEW |