From dcfca431e3c350e17eedb3402cc63577cea8d4ea Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Wed, 15 Nov 2017 15:48:03 -0500 Subject: Use GrContextFactories that produce a single GrContext in unit tests. This is to alleviate problems due to the command buffer getting bent out of shape when the current OpenGL context is switched out from under it (because we ran a test with a native GL context). This, however is not a full solution. More changes will be required to ensure that after running each command buffer or native test we bind the null context. This does allow us to take a step in that direction without breaking anything too badly. Moreover, there is no real benefit to reusing a GrContextFactory. Modifies DEF_GPUTEST to take GrContextOptions rather than a factory to use. Tests were already using their own factories anyway. In tests that use GrContextFactory the factory instance is moved to the inner loop. Modifies gpucts and skia_test to not use persistent GrContextFactories. Change-Id: Ie7a36793545c775f2f30653ead6fec93a3d22717 Reviewed-on: https://skia-review.googlesource.com/71861 Reviewed-by: Brian Osman Commit-Queue: Brian Salomon --- tests/ResourceCacheTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/ResourceCacheTest.cpp') diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp index 863830aefe..0d977796cd 100644 --- a/tests/ResourceCacheTest.cpp +++ b/tests/ResourceCacheTest.cpp @@ -1596,7 +1596,7 @@ static void test_tags(skiatest::Reporter* reporter) { #endif } -DEF_GPUTEST(ResourceCacheMisc, reporter, factory) { +DEF_GPUTEST(ResourceCacheMisc, reporter, /* options */) { // The below tests create their own mock contexts. test_no_key(reporter); test_budgeting(reporter); -- cgit v1.2.3