From 549be4aa184d445ef66b1934582ca6f07e83b31e Mon Sep 17 00:00:00 2001 From: Hal Canary Date: Fri, 5 Jan 2018 16:59:53 -0500 Subject: Fuzz: GrContextFactory needs to stay in scope Change-Id: I5d6bd4fae2e98e5286eefd9399292dfb926f85df Reviewed-on: https://skia-review.googlesource.com/91701 Reviewed-by: Brian Salomon Reviewed-by: Kevin Lubick Commit-Queue: Hal Canary --- fuzz/FuzzCanvas.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'fuzz/FuzzCanvas.cpp') diff --git a/fuzz/FuzzCanvas.cpp b/fuzz/FuzzCanvas.cpp index 38281ae97c..e125188e70 100644 --- a/fuzz/FuzzCanvas.cpp +++ b/fuzz/FuzzCanvas.cpp @@ -1792,23 +1792,22 @@ static void fuzz_ganesh(Fuzz* fuzz, GrContext* context) { } DEF_FUZZ(NativeGLCanvas, fuzz) { - GrContext* context = sk_gpu_test::GrContextFactory().get( - sk_gpu_test::GrContextFactory::kGL_ContextType); + sk_gpu_test::GrContextFactory f; + GrContext* context = f.get(sk_gpu_test::GrContextFactory::kGL_ContextType); if (!context) { - context = sk_gpu_test::GrContextFactory().get( - sk_gpu_test::GrContextFactory::kGLES_ContextType); + context = f.get(sk_gpu_test::GrContextFactory::kGLES_ContextType); } fuzz_ganesh(fuzz, context); } DEF_FUZZ(NullGLCanvas, fuzz) { - fuzz_ganesh(fuzz, sk_gpu_test::GrContextFactory().get( - sk_gpu_test::GrContextFactory::kNullGL_ContextType)); + sk_gpu_test::GrContextFactory f; + fuzz_ganesh(fuzz, f.get(sk_gpu_test::GrContextFactory::kNullGL_ContextType)); } DEF_FUZZ(DebugGLCanvas, fuzz) { - fuzz_ganesh(fuzz, sk_gpu_test::GrContextFactory().get( - sk_gpu_test::GrContextFactory::kDebugGL_ContextType)); + sk_gpu_test::GrContextFactory f; + fuzz_ganesh(fuzz, f.get(sk_gpu_test::GrContextFactory::kDebugGL_ContextType)); } #endif -- cgit v1.2.3