diff options
author | Brian Salomon <bsalomon@google.com> | 2017-04-25 15:03:41 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-25 19:53:53 +0000 |
commit | 290c69052b3e734000046cd674c60158b0faa679 (patch) | |
tree | 1ec318a24bb6f2d696e5a05c1004c858d9f39729 /src | |
parent | 3deaeb2dc0cfddfdf2e3b64736c860132619a051 (diff) |
Add ability to relinquish control of VkDevice and VkInstance lifetime to GrVkBackendContext
Change-Id: I355a8bf573a84b4ba7cbfeed60feec13e251b352
Reviewed-on: https://skia-review.googlesource.com/14303
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/vk/GrVkBackendContext.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gpu/vk/GrVkBackendContext.cpp b/src/gpu/vk/GrVkBackendContext.cpp index 2d8a7d5f66..fea1947489 100644 --- a/src/gpu/vk/GrVkBackendContext.cpp +++ b/src/gpu/vk/GrVkBackendContext.cpp @@ -301,12 +301,13 @@ const GrVkBackendContext* GrVkBackendContext::Create(uint32_t* presentQueueIndex ctx->fExtensions = extensionFlags; ctx->fFeatures = featureFlags; ctx->fInterface.reset(interface.release()); + ctx->fOwnsInstanceAndDevice = true; return ctx; } GrVkBackendContext::~GrVkBackendContext() { - if (fInterface == nullptr) { + if (fInterface == nullptr || !fOwnsInstanceAndDevice) { return; } |