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

Side by Side Diff: gpu/command_buffer/client/client_test_helper.cc

Issue 1859703002: convert //gpu to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo part of clang-format 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Tests for GLES2Implementation. 5 // Tests for GLES2Implementation.
6 6
7 #include "gpu/command_buffer/client/client_test_helper.h" 7 #include "gpu/command_buffer/client/client_test_helper.h"
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 #include <stdint.h> 10 #include <stdint.h>
11 11
no sievers 2016/04/05 19:02:40 #include <memory>
Mostyn Bramley-Moore 2016/04/05 21:35:30 Done.
12 #include "gpu/command_buffer/client/cmd_buffer_helper.h" 12 #include "gpu/command_buffer/client/cmd_buffer_helper.h"
13 #include "gpu/command_buffer/common/command_buffer.h" 13 #include "gpu/command_buffer/common/command_buffer.h"
14 #include "testing/gmock/include/gmock/gmock.h" 14 #include "testing/gmock/include/gmock/gmock.h"
15 15
16 using ::testing::_; 16 using ::testing::_;
17 using ::testing::Invoke; 17 using ::testing::Invoke;
18 18
19 namespace gpu { 19 namespace gpu {
20 20
21 MockCommandBufferBase::MockCommandBufferBase() : put_offset_(0) { 21 MockCommandBufferBase::MockCommandBufferBase() : put_offset_(0) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 return -1; 66 return -1;
67 } 67 }
68 68
69 scoped_refptr<gpu::Buffer> MockCommandBufferBase::CreateTransferBuffer( 69 scoped_refptr<gpu::Buffer> MockCommandBufferBase::CreateTransferBuffer(
70 size_t size, 70 size_t size,
71 int32_t* id) { 71 int32_t* id) {
72 *id = GetNextFreeTransferBufferId(); 72 *id = GetNextFreeTransferBufferId();
73 if (*id >= 0) { 73 if (*id >= 0) {
74 int32_t ndx = *id - kTransferBufferBaseId; 74 int32_t ndx = *id - kTransferBufferBaseId;
75 scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory()); 75 std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
76 shared_memory->CreateAndMapAnonymous(size); 76 shared_memory->CreateAndMapAnonymous(size);
77 transfer_buffer_buffers_[ndx] = 77 transfer_buffer_buffers_[ndx] =
78 MakeBufferFromSharedMemory(std::move(shared_memory), size); 78 MakeBufferFromSharedMemory(std::move(shared_memory), size);
79 } 79 }
80 return GetTransferBuffer(*id); 80 return GetTransferBuffer(*id);
81 } 81 }
82 82
83 void MockCommandBufferBase::DestroyTransferBufferHelper(int32_t id) { 83 void MockCommandBufferBase::DestroyTransferBufferHelper(int32_t id) {
84 DCHECK_GE(id, kTransferBufferBaseId); 84 DCHECK_GE(id, kTransferBufferBaseId);
85 DCHECK_LT(id, kTransferBufferBaseId + kMaxTransferBuffers); 85 DCHECK_LT(id, kTransferBufferBaseId + kMaxTransferBuffers);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 160
161 MockClientGpuControl::MockClientGpuControl() { 161 MockClientGpuControl::MockClientGpuControl() {
162 } 162 }
163 163
164 MockClientGpuControl::~MockClientGpuControl() { 164 MockClientGpuControl::~MockClientGpuControl() {
165 } 165 }
166 166
167 } // namespace gpu 167 } // namespace gpu
168 168
169 169
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698