aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ImageTest.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-06-08 16:03:17 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-08 20:29:44 +0000
commitcdabbcc3b57f7c7e3ef1c28538c9e91b7a1eaa33 (patch)
treea3775adc12bca9a8cd8d3b7186d58afefd5bec93 /tests/ImageTest.cpp
parentba81af27cff1c1e23051d2957612b2f3e0fbf885 (diff)
Store context type (rather than backend type) in ContextInfo
Change-Id: I7dbfb735f1f094fa0a025b84f69e06a3533f2815 Reviewed-on: https://skia-review.googlesource.com/19101 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/ImageTest.cpp')
-rw-r--r--tests/ImageTest.cpp23
1 files changed, 3 insertions, 20 deletions
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<sk_sp<SkImage>()> 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<GrContextThreadSafeProxy> 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);