Chromium Code Reviews| Index: include/gpu/GrEffectUnitTest.h |
| =================================================================== |
| --- include/gpu/GrEffectUnitTest.h (revision 8365) |
| +++ include/gpu/GrEffectUnitTest.h (working copy) |
| @@ -8,11 +8,12 @@ |
| #ifndef GrEffectUnitTest_DEFINED |
| #define GrEffectUnitTest_DEFINED |
| +#include "GrNoncopyable.h" |
| #include "SkRandom.h" |
| -#include "GrNoncopyable.h" |
| #include "SkTArray.h" |
| class SkMatrix; |
| +class GrDrawTargetCaps; |
| namespace GrEffectUnitTest { |
| // Used to access the dummy textures in TestCreate procs. |
| @@ -37,7 +38,10 @@ |
| class GrEffectTestFactory : GrNoncopyable { |
| public: |
| - typedef GrEffectRef* (*CreateProc)(SkMWCRandom*, GrContext*, GrTexture* dummyTextures[]); |
| + typedef GrEffectRef* (*CreateProc)(SkMWCRandom*, |
| + GrContext*, |
| + const GrDrawTargetCaps& caps, |
| + GrTexture* dummyTextures[]); |
| GrEffectTestFactory(CreateProc createProc) { |
| fCreateProc = createProc; |
| @@ -46,10 +50,11 @@ |
| static GrEffectRef* CreateStage(SkMWCRandom* random, |
| GrContext* context, |
| + const GrDrawTargetCaps& caps, |
| GrTexture* dummyTextures[]) { |
| uint32_t idx = random->nextRangeU(0, GetFactories()->count() - 1); |
| GrEffectTestFactory* factory = (*GetFactories())[idx]; |
| - return factory->fCreateProc(random, context, dummyTextures); |
| + return factory->fCreateProc(random, context, caps, dummyTextures); |
| } |
| private: |
| @@ -62,11 +67,17 @@ |
| */ |
|
robertphillips
2013/03/25 18:11:36
line up trailing '\'s?
bsalomon
2013/03/25 18:20:14
Done.
|
| #define GR_DECLARE_EFFECT_TEST \ |
| static GrEffectTestFactory gTestFactory; \ |
| - static GrEffectRef* TestCreate(SkMWCRandom*, GrContext*, GrTexture* dummyTextures[2]) |
| + static GrEffectRef* TestCreate(SkMWCRandom*, \ |
| + GrContext*, \ |
| + const GrDrawTargetCaps&, \ |
| + GrTexture* dummyTextures[2]) |
| /** GrEffect subclasses should insert this macro in their implementation file. They must then |
| * also implement this static function: |
| - * GrEffect* TestCreate(SkMWCRandom*, GrContext*, GrTexture* dummyTextures[2]); |
| + * GrEffect* TestCreate(SkMWCRandom*, |
| + * GrContext*, |
| + * const GrDrawTargetCaps&, |
| + * GrTexture* dummyTextures[2]); |
| * dummyTextures[] are valid textures that can optionally be used to construct GrTextureAccesses. |
| * The first texture has config kSkia8888_GrPixelConfig and the second has |
| * kAlpha_8_GrPixelConfig. TestCreate functions are also free to create additional textures using |
| @@ -79,8 +90,11 @@ |
| // The unit test relies on static initializers. Just declare the TestCreate function so that |
| // its definitions will compile. |
|
robertphillips
2013/03/25 18:11:36
same here?
bsalomon
2013/03/25 18:20:14
Done.
|
| -#define GR_DECLARE_EFFECT_TEST \ |
| - static GrEffectRef* TestCreate(SkMWCRandom*, GrContext*, GrTexture* dummyTextures[2]) |
| +#define GR_DECLARE_EFFECT_TEST \ |
| + static GrEffectRef* TestCreate(SkMWCRandom*, \ |
| + GrContext*, \ |
| + const GrDrawTargetCaps&, \ |
| + GrTexture* dummyTextures[2]) |
| #define GR_DEFINE_EFFECT_TEST(X) |
| #endif // !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |