aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/gpu/GrContextFactory.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-05-15 13:50:35 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-15 18:12:59 +0000
commit604b197c6b3262206d99e71030a8071bcc36083d (patch)
tree515305bd831fb16f8170ae4b2a16f09553b117e5 /tools/gpu/GrContextFactory.cpp
parentbca46e29e9f96999df0b38fb9359e71b73217c94 (diff)
Add support for creating a shared vulkan test context
Bug: skia: Change-Id: I997c6269e4676bf4cedddcd87e71d107053678bb Reviewed-on: https://skia-review.googlesource.com/16905 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'tools/gpu/GrContextFactory.cpp')
-rw-r--r--tools/gpu/GrContextFactory.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/gpu/GrContextFactory.cpp b/tools/gpu/GrContextFactory.cpp
index e02bc1b371..5aa57853b5 100644
--- a/tools/gpu/GrContextFactory.cpp
+++ b/tools/gpu/GrContextFactory.cpp
@@ -189,16 +189,14 @@ ContextInfo GrContextFactory::getContextInfoInternal(ContextType type, ContextOv
break;
}
#ifdef SK_VULKAN
- case kVulkan_GrBackend:
- if (masterContext) {
- // Shared contexts not supported yet
- return ContextInfo();
- }
+ case kVulkan_GrBackend: {
+ VkTestContext* vkSharedContext = masterContext
+ ? static_cast<VkTestContext*>(masterContext->fTestContext) : nullptr;
SkASSERT(kVulkan_ContextType == type);
if (ContextOverrides::kRequireNVPRSupport & overrides) {
return ContextInfo();
}
- testCtx.reset(CreatePlatformVkTestContext());
+ testCtx.reset(CreatePlatformVkTestContext(vkSharedContext));
if (!testCtx) {
return ContextInfo();
}
@@ -214,6 +212,7 @@ ContextInfo GrContextFactory::getContextInfoInternal(ContextType type, ContextOv
}
backendContext = testCtx->backendContext();
break;
+ }
#endif
default:
return ContextInfo();