Fuzz: GrContextFactory needs to stay in scope

Change-Id: I5d6bd4fae2e98e5286eefd9399292dfb926f85df
Reviewed-on: https://skia-review.googlesource.com/91701
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
This commit is contained in:
Hal Canary 2018-01-05 16:59:53 -05:00 committed by Skia Commit-Bot
parent 3c7d882c48
commit 549be4aa18

View File

@ -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