From cdabbcc3b57f7c7e3ef1c28538c9e91b7a1eaa33 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Thu, 8 Jun 2017 16:03:17 -0400 Subject: Store context type (rather than backend type) in ContextInfo Change-Id: I7dbfb735f1f094fa0a025b84f69e06a3533f2815 Reviewed-on: https://skia-review.googlesource.com/19101 Reviewed-by: Brian Salomon Commit-Queue: Robert Phillips --- tests/ImageTest.cpp | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'tests') diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp index c747b8ea5b..5b28f00950 100644 --- a/tests/ImageTest.cpp +++ b/tests/ImageTest.cpp @@ -446,27 +446,11 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(c, reporter, ctxInfo) { } } -GrContextFactory::ContextType pick_second_context_type(const sk_gpu_test::ContextInfo& info) { - switch (info.backend()) { - case kOpenGL_GrBackend: -#if defined(SK_BUILD_FOR_WIN) || defined(SK_BUILD_FOR_UNIX) || defined (SK_BUILD_FOR_MAC) - return GrContextFactory::kGL_ContextType; -#else - return GrContextFactory::kGLES_ContextType; -#endif - case kVulkan_GrBackend: - return GrContextFactory::kVulkan_ContextType; - } - SkFAIL("Unknown backend type."); - return GrContextFactory::kGL_ContextType; -} - DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkImage_makeTextureImage, reporter, contextInfo) { GrContext* context = contextInfo.grContext(); sk_gpu_test::TestContext* testContext = contextInfo.testContext(); GrContextFactory otherFactory; - GrContextFactory::ContextType otherContextType = pick_second_context_type(contextInfo); - ContextInfo otherContextInfo = otherFactory.getContextInfo(otherContextType); + ContextInfo otherContextInfo = otherFactory.getContextInfo(contextInfo.type()); testContext->makeCurrent(); std::function()> imageFactories[] = { @@ -911,7 +895,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SkImage_MakeCrossContextRelease, reporter, sk_gpu_test::TestContext* testContext = ctxInfo.testContext(); GrContextFactory otherFactory; - ContextInfo otherContextInfo = otherFactory.getContextInfo(pick_second_context_type(ctxInfo)); + ContextInfo otherContextInfo = otherFactory.getContextInfo(ctxInfo.type()); GrContext* otherCtx = otherContextInfo.grContext(); sk_gpu_test::TestContext* otherTestContext = otherContextInfo.testContext(); @@ -1030,8 +1014,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredTextureImage, reporter, ctxInfo) { sk_sp proxy = context->threadSafeProxy(); GrContextFactory otherFactory; - ContextInfo otherContextInfo = - otherFactory.getContextInfo(pick_second_context_type(ctxInfo)); + ContextInfo otherContextInfo = otherFactory.getContextInfo(ctxInfo.type()); testContext->makeCurrent(); REPORTER_ASSERT(reporter, proxy); -- cgit v1.2.3