Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: cc/output/vulkan_in_process_context_provider.cc

Issue 1829163003: Added initial implementation of the Vulkan Context Provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@vk_surface_patch
Patch Set: Block off vulkan_cc with enable_vulkan (not relevant in future patch) Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/output/vulkan_in_process_context_provider.h ('k') | gpu/vulkan/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/output/vulkan_in_process_context_provider.h"
6
7 #include <vector>
8
9 #include "gpu/vulkan/vulkan_device_queue.h"
10
11 #if defined(VK_USE_PLATFORM_XLIB_KHR)
12 #include "ui/gfx/x/x11_types.h"
13 #endif // defined(VK_USE_PLATFORM_XLIB_KHR)
14
15 namespace cc {
16
17 scoped_refptr<VulkanInProcessContextProvider>
18 VulkanInProcessContextProvider::Create() {
19 scoped_refptr<VulkanInProcessContextProvider> context_provider(
20 new VulkanInProcessContextProvider);
21 if (!context_provider->Initialize())
22 return nullptr;
23 return context_provider;
24 }
25
26 bool VulkanInProcessContextProvider::Initialize() {
27 scoped_ptr<gpu::VulkanDeviceQueue> device_queue(new gpu::VulkanDeviceQueue);
28 if (device_queue->Initialize(
29 gpu::VulkanDeviceQueue::GRAPHICS_QUEUE_FLAG |
30 gpu::VulkanDeviceQueue::PRESENTATION_SUPPORT_QUEUE_FLAG)) {
31 device_queue_ = std::move(device_queue);
32 return true;
33 }
34
35 return false;
36 }
37
38 void VulkanInProcessContextProvider::Destroy() {
39 if (device_queue_) {
40 device_queue_->Destroy();
41 device_queue_.reset();
42 }
43 }
44
45 gpu::VulkanDeviceQueue* VulkanInProcessContextProvider::GetDeviceQueue() {
46 return device_queue_.get();
47 }
48
49 VulkanInProcessContextProvider::VulkanInProcessContextProvider() {}
50
51 VulkanInProcessContextProvider::~VulkanInProcessContextProvider() {}
52
53 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/vulkan_in_process_context_provider.h ('k') | gpu/vulkan/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698