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

Unified Diff: dm/DM.cpp

Issue 1555053003: Revert of Make SkGLContext lifetime more well-defined (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 ba8ad926ad53a486409736b535c547bc78d8ad22..ace49076ac74427c58486d13e43ea4acf59aeed1 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -1147,16 +1147,16 @@
typedef void(*TestWithGrContextAndGLContext)(skiatest::Reporter*, GrContext*, SkGLContext*);
#if SK_SUPPORT_GPU
template<typename T>
-void call_test(T test, skiatest::Reporter* reporter, const GrContextFactory::ContextInfo& context);
+void call_test(T test, skiatest::Reporter* reporter, GrContextFactory::ContextInfo* context);
template<>
void call_test(TestWithGrContext test, skiatest::Reporter* reporter,
- const GrContextFactory::ContextInfo& context) {
- test(reporter, context.fGrContext);
+ GrContextFactory::ContextInfo* context) {
+ test(reporter, context->fGrContext);
}
template<>
void call_test(TestWithGrContextAndGLContext test, skiatest::Reporter* reporter,
- const GrContextFactory::ContextInfo& context) {
- test(reporter, context.fGrContext, context.fGLContext);
+ GrContextFactory::ContextInfo* context) {
+ test(reporter, context->fGrContext, context->fGLContext);
}
#endif
} // namespace
@@ -1202,13 +1202,11 @@
if ((testContexts & contextSelector) == 0) {
continue;
}
- GrContextFactory::ContextInfo context = factory->getContextInfo(contextType);
- if (context.fGrContext) {
+ if (GrContextFactory::ContextInfo* context = factory->getContextInfo(contextType)) {
call_test(test, reporter, context);
}
- context = factory->getContextInfo(contextType,
- GrContextFactory::kEnableNVPR_GLContextOptions);
- if (context.fGrContext) {
+ if (GrContextFactory::ContextInfo* context =
+ factory->getContextInfo(contextType, GrContextFactory::kEnableNVPR_GLContextOptions)) {
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