aboutsummaryrefslogtreecommitdiff
path: root/tests/GLProgramsTest.cpp
diff options
context:
space:
mode:
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-04 16:13:32 +0000
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-04 16:13:32 +0000
commit67b915de99e6b89d476907930ac8c27afb64d10e (patch)
tree75e0c17ae09477f51ebd8561af40b5c0931433ad /tests/GLProgramsTest.cpp
parent7de18e5c7b4e4a8ad8910b1016688ded902f185b (diff)
Make GPU unit tests use GrContexts of different GL types.
Review URL: https://codereview.appspot.com/7281046 git-svn-id: http://skia.googlecode.com/svn/trunk@7540 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/GLProgramsTest.cpp')
-rw-r--r--tests/GLProgramsTest.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 3106377d84..b93f9c3269 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -14,6 +14,7 @@
#include "gl/GrGpuGL.h"
#include "GrBackendEffectFactory.h"
+#include "GrContextFactory.h"
#include "effects/GrConfigConversionEffect.h"
#include "SkRandom.h"
@@ -147,9 +148,14 @@ bool GrGpuGL::programUnitTest() {
return true;
}
-static void GLProgramsTest(skiatest::Reporter* reporter, GrContext* context) {
- GrGpuGL* shadersGpu = static_cast<GrGpuGL*>(context->getGpu());
- REPORTER_ASSERT(reporter, shadersGpu->programUnitTest());
+static void GLProgramsTest(skiatest::Reporter* reporter, GrContextFactory* factory) {
+ for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) {
+ GrContext* context = factory->get(static_cast<GrContextFactory::GLContextType>(type));
+ if (NULL != context) {
+ GrGpuGL* shadersGpu = static_cast<GrGpuGL*>(context->getGpu());
+ REPORTER_ASSERT(reporter, shadersGpu->programUnitTest());
+ }
+ }
}
#include "TestClassDef.h"