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

Unified 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, 9 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/vulkan_in_process_context_provider.cc
diff --git a/cc/output/vulkan_in_process_context_provider.cc b/cc/output/vulkan_in_process_context_provider.cc
new file mode 100644
index 0000000000000000000000000000000000000000..67e11222134d22978122f5e8c999f40165c73847
--- /dev/null
+++ b/cc/output/vulkan_in_process_context_provider.cc
@@ -0,0 +1,53 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/output/vulkan_in_process_context_provider.h"
+
+#include <vector>
+
+#include "gpu/vulkan/vulkan_device_queue.h"
+
+#if defined(VK_USE_PLATFORM_XLIB_KHR)
+#include "ui/gfx/x/x11_types.h"
+#endif // defined(VK_USE_PLATFORM_XLIB_KHR)
+
+namespace cc {
+
+scoped_refptr<VulkanInProcessContextProvider>
+VulkanInProcessContextProvider::Create() {
+ scoped_refptr<VulkanInProcessContextProvider> context_provider(
+ new VulkanInProcessContextProvider);
+ if (!context_provider->Initialize())
+ return nullptr;
+ return context_provider;
+}
+
+bool VulkanInProcessContextProvider::Initialize() {
+ scoped_ptr<gpu::VulkanDeviceQueue> device_queue(new gpu::VulkanDeviceQueue);
+ if (device_queue->Initialize(
+ gpu::VulkanDeviceQueue::GRAPHICS_QUEUE_FLAG |
+ gpu::VulkanDeviceQueue::PRESENTATION_SUPPORT_QUEUE_FLAG)) {
+ device_queue_ = std::move(device_queue);
+ return true;
+ }
+
+ return false;
+}
+
+void VulkanInProcessContextProvider::Destroy() {
+ if (device_queue_) {
+ device_queue_->Destroy();
+ device_queue_.reset();
+ }
+}
+
+gpu::VulkanDeviceQueue* VulkanInProcessContextProvider::GetDeviceQueue() {
+ return device_queue_.get();
+}
+
+VulkanInProcessContextProvider::VulkanInProcessContextProvider() {}
+
+VulkanInProcessContextProvider::~VulkanInProcessContextProvider() {}
+
+} // namespace cc
« 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