Index: dm/DM.cpp |
diff --git a/dm/DM.cpp b/dm/DM.cpp |
index ace49076ac74427c58486d13e43ea4acf59aeed1..ba8ad926ad53a486409736b535c547bc78d8ad22 100644 |
--- a/dm/DM.cpp |
+++ b/dm/DM.cpp |
@@ -1147,16 +1147,16 @@ typedef void(*TestWithGrContext)(skiatest::Reporter*, GrContext*); |
typedef void(*TestWithGrContextAndGLContext)(skiatest::Reporter*, GrContext*, SkGLContext*); |
#if SK_SUPPORT_GPU |
template<typename T> |
-void call_test(T test, skiatest::Reporter* reporter, GrContextFactory::ContextInfo* context); |
+void call_test(T test, skiatest::Reporter* reporter, const GrContextFactory::ContextInfo& context); |
template<> |
void call_test(TestWithGrContext test, skiatest::Reporter* reporter, |
- GrContextFactory::ContextInfo* context) { |
- test(reporter, context->fGrContext); |
+ const GrContextFactory::ContextInfo& context) { |
+ test(reporter, context.fGrContext); |
} |
template<> |
void call_test(TestWithGrContextAndGLContext test, skiatest::Reporter* reporter, |
- GrContextFactory::ContextInfo* context) { |
- test(reporter, context->fGrContext, context->fGLContext); |
+ const GrContextFactory::ContextInfo& context) { |
+ test(reporter, context.fGrContext, context.fGLContext); |
} |
#endif |
} // namespace |
@@ -1202,11 +1202,13 @@ void RunWithGPUTestContexts(T test, GPUTestContexts testContexts, Reporter* repo |
if ((testContexts & contextSelector) == 0) { |
continue; |
} |
- if (GrContextFactory::ContextInfo* context = factory->getContextInfo(contextType)) { |
+ GrContextFactory::ContextInfo context = factory->getContextInfo(contextType); |
+ if (context.fGrContext) { |
call_test(test, reporter, context); |
} |
- if (GrContextFactory::ContextInfo* context = |
- factory->getContextInfo(contextType, GrContextFactory::kEnableNVPR_GLContextOptions)) { |
+ context = factory->getContextInfo(contextType, |
+ GrContextFactory::kEnableNVPR_GLContextOptions); |
+ if (context.fGrContext) { |
call_test(test, reporter, context); |
} |
} |