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

Side by Side Diff: gpu/vulkan/vulkan_command_pool.cc

Issue 1859703002: convert //gpu to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master 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 | « gpu/vulkan/vulkan_command_pool.h ('k') | gpu/vulkan/vulkan_device_queue.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 "gpu/vulkan/vulkan_command_pool.h" 5 #include "gpu/vulkan/vulkan_command_pool.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "gpu/vulkan/vulkan_command_buffer.h" 8 #include "gpu/vulkan/vulkan_command_buffer.h"
9 #include "gpu/vulkan/vulkan_device_queue.h" 9 #include "gpu/vulkan/vulkan_device_queue.h"
10 #include "gpu/vulkan/vulkan_implementation.h" 10 #include "gpu/vulkan/vulkan_implementation.h"
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 void VulkanCommandPool::Destroy() { 41 void VulkanCommandPool::Destroy() {
42 DCHECK_EQ(0u, command_buffer_count_); 42 DCHECK_EQ(0u, command_buffer_count_);
43 if (VK_NULL_HANDLE != handle_) { 43 if (VK_NULL_HANDLE != handle_) {
44 vkDestroyCommandPool(device_queue_->GetVulkanDevice(), handle_, nullptr); 44 vkDestroyCommandPool(device_queue_->GetVulkanDevice(), handle_, nullptr);
45 handle_ = VK_NULL_HANDLE; 45 handle_ = VK_NULL_HANDLE;
46 } 46 }
47 } 47 }
48 48
49 scoped_ptr<VulkanCommandBuffer> 49 std::unique_ptr<VulkanCommandBuffer>
50 VulkanCommandPool::CreatePrimaryCommandBuffer() { 50 VulkanCommandPool::CreatePrimaryCommandBuffer() {
51 scoped_ptr<VulkanCommandBuffer> command_buffer( 51 std::unique_ptr<VulkanCommandBuffer> command_buffer(
52 new VulkanCommandBuffer(device_queue_, this, true)); 52 new VulkanCommandBuffer(device_queue_, this, true));
53 if (!command_buffer->Initialize()) 53 if (!command_buffer->Initialize())
54 return nullptr; 54 return nullptr;
55 55
56 return command_buffer; 56 return command_buffer;
57 } 57 }
58 58
59 scoped_ptr<VulkanCommandBuffer> 59 std::unique_ptr<VulkanCommandBuffer>
60 VulkanCommandPool::CreateSecondaryCommandBuffer() { 60 VulkanCommandPool::CreateSecondaryCommandBuffer() {
61 scoped_ptr<VulkanCommandBuffer> command_buffer( 61 std::unique_ptr<VulkanCommandBuffer> command_buffer(
62 new VulkanCommandBuffer(device_queue_, this, false)); 62 new VulkanCommandBuffer(device_queue_, this, false));
63 if (!command_buffer->Initialize()) 63 if (!command_buffer->Initialize())
64 return nullptr; 64 return nullptr;
65 65
66 return command_buffer; 66 return command_buffer;
67 } 67 }
68 68
69 void VulkanCommandPool::IncrementCommandBufferCount() { 69 void VulkanCommandPool::IncrementCommandBufferCount() {
70 command_buffer_count_++; 70 command_buffer_count_++;
71 } 71 }
72 72
73 void VulkanCommandPool::DecrementCommandBufferCount() { 73 void VulkanCommandPool::DecrementCommandBufferCount() {
74 DCHECK_LT(0u, command_buffer_count_); 74 DCHECK_LT(0u, command_buffer_count_);
75 command_buffer_count_--; 75 command_buffer_count_--;
76 } 76 }
77 77
78 } // namespace gpu 78 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/vulkan/vulkan_command_pool.h ('k') | gpu/vulkan/vulkan_device_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698