Index: tests/Test.h |
diff --git a/tests/Test.h b/tests/Test.h |
index 0a9c306b15963c4d1c611cbd13243f469c0c4edc..4d2cf2b6392349ed0751eb52274d3d219d27b7d9 100644 |
--- a/tests/Test.h |
+++ b/tests/Test.h |
@@ -62,9 +62,11 @@ namespace skiatest { |
static SkString GetTmpDir(); |
+ static void SetResourcePath(const char*); |
static SkString GetResourcePath(); |
virtual bool isGPUTest() const { return false; } |
+ virtual void setGrContextFactory(GrContextFactory* factory) {} |
protected: |
virtual void onGetName(SkString*) = 0; |
@@ -79,11 +81,15 @@ namespace skiatest { |
class GpuTest : public Test{ |
public: |
- GpuTest() : Test() {} |
- static GrContextFactory* GetGrContextFactory(); |
- static void DestroyContexts(); |
+ GpuTest() : Test(), fGrContextFactory(NULL) {} |
+ |
virtual bool isGPUTest() const { return true; } |
- private: |
+ virtual void setGrContextFactory(GrContextFactory* factory) { |
+ fGrContextFactory = factory; |
+ } |
+ |
+ protected: |
+ GrContextFactory* fGrContextFactory; // Unowned. |
}; |
typedef SkTRegistry<Test*(*)(void*)> TestRegistry; |
@@ -162,7 +168,7 @@ namespace skiatest { |
name->set(#name); \ |
} \ |
virtual void onRun(Reporter* r) SK_OVERRIDE { \ |
- name(r, GetGrContextFactory()); \ |
+ name(r, fGrContextFactory); \ |
} \ |
}; \ |
static TestRegistry gReg_##name##Class(name##Class::Factory); \ |