Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Unified Diff: dm/DM.cpp

Issue 1511773005: Make SkGLContext lifetime more well-defined (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix the test Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bench/nanobench.cpp ('k') | gyp/pathops_unittest.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « bench/nanobench.cpp ('k') | gyp/pathops_unittest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698