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

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

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase 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') | cc/output/vulkan_renderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/output/vulkan_in_process_context_provider.h" 5 #include "cc/output/vulkan_in_process_context_provider.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "gpu/vulkan/vulkan_device_queue.h" 9 #include "gpu/vulkan/vulkan_device_queue.h"
10 10
11 #if defined(VK_USE_PLATFORM_XLIB_KHR) 11 #if defined(VK_USE_PLATFORM_XLIB_KHR)
12 #include "ui/gfx/x/x11_types.h" 12 #include "ui/gfx/x/x11_types.h"
13 #endif // defined(VK_USE_PLATFORM_XLIB_KHR) 13 #endif // defined(VK_USE_PLATFORM_XLIB_KHR)
14 14
15 namespace cc { 15 namespace cc {
16 16
17 scoped_refptr<VulkanInProcessContextProvider> 17 scoped_refptr<VulkanInProcessContextProvider>
18 VulkanInProcessContextProvider::Create() { 18 VulkanInProcessContextProvider::Create() {
19 scoped_refptr<VulkanInProcessContextProvider> context_provider( 19 scoped_refptr<VulkanInProcessContextProvider> context_provider(
20 new VulkanInProcessContextProvider); 20 new VulkanInProcessContextProvider);
21 if (!context_provider->Initialize()) 21 if (!context_provider->Initialize())
22 return nullptr; 22 return nullptr;
23 return context_provider; 23 return context_provider;
24 } 24 }
25 25
26 bool VulkanInProcessContextProvider::Initialize() { 26 bool VulkanInProcessContextProvider::Initialize() {
27 scoped_ptr<gpu::VulkanDeviceQueue> device_queue(new gpu::VulkanDeviceQueue); 27 std::unique_ptr<gpu::VulkanDeviceQueue> device_queue(
28 new gpu::VulkanDeviceQueue);
28 if (device_queue->Initialize( 29 if (device_queue->Initialize(
29 gpu::VulkanDeviceQueue::GRAPHICS_QUEUE_FLAG | 30 gpu::VulkanDeviceQueue::GRAPHICS_QUEUE_FLAG |
30 gpu::VulkanDeviceQueue::PRESENTATION_SUPPORT_QUEUE_FLAG)) { 31 gpu::VulkanDeviceQueue::PRESENTATION_SUPPORT_QUEUE_FLAG)) {
31 device_queue_ = std::move(device_queue); 32 device_queue_ = std::move(device_queue);
32 return true; 33 return true;
33 } 34 }
34 35
35 return false; 36 return false;
36 } 37 }
37 38
38 void VulkanInProcessContextProvider::Destroy() { 39 void VulkanInProcessContextProvider::Destroy() {
39 if (device_queue_) { 40 if (device_queue_) {
40 device_queue_->Destroy(); 41 device_queue_->Destroy();
41 device_queue_.reset(); 42 device_queue_.reset();
42 } 43 }
43 } 44 }
44 45
45 gpu::VulkanDeviceQueue* VulkanInProcessContextProvider::GetDeviceQueue() { 46 gpu::VulkanDeviceQueue* VulkanInProcessContextProvider::GetDeviceQueue() {
46 return device_queue_.get(); 47 return device_queue_.get();
47 } 48 }
48 49
49 VulkanInProcessContextProvider::VulkanInProcessContextProvider() {} 50 VulkanInProcessContextProvider::VulkanInProcessContextProvider() {}
50 51
51 VulkanInProcessContextProvider::~VulkanInProcessContextProvider() {} 52 VulkanInProcessContextProvider::~VulkanInProcessContextProvider() {}
52 53
53 } // namespace cc 54 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/vulkan_in_process_context_provider.h ('k') | cc/output/vulkan_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698