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

Side by Side Diff: cc/test/test_gpu_memory_buffer_manager.cc

Issue 2258833002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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/test/remote_proto_channel_bridge.cc ('k') | cc/test/test_layer_tree_host_base.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/test/test_gpu_memory_buffer_manager.h" 5 #include "cc/test/test_gpu_memory_buffer_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 TestGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle( 176 TestGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle(
177 const gfx::GpuMemoryBufferHandle& handle, 177 const gfx::GpuMemoryBufferHandle& handle,
178 const gfx::Size& size, 178 const gfx::Size& size,
179 gfx::BufferFormat format) { 179 gfx::BufferFormat format) {
180 if (handle.type != gfx::SHARED_MEMORY_BUFFER) 180 if (handle.type != gfx::SHARED_MEMORY_BUFFER)
181 return nullptr; 181 return nullptr;
182 182
183 last_gpu_memory_buffer_id_ += 1; 183 last_gpu_memory_buffer_id_ += 1;
184 std::unique_ptr<gfx::GpuMemoryBuffer> result(new GpuMemoryBufferImpl( 184 std::unique_ptr<gfx::GpuMemoryBuffer> result(new GpuMemoryBufferImpl(
185 this, last_gpu_memory_buffer_id_, size, format, 185 this, last_gpu_memory_buffer_id_, size, format,
186 base::WrapUnique(new base::SharedMemory(handle.handle, false)), 186 base::MakeUnique<base::SharedMemory>(handle.handle, false), handle.offset,
187 handle.offset, handle.stride)); 187 handle.stride));
188 buffers_[last_gpu_memory_buffer_id_] = result.get(); 188 buffers_[last_gpu_memory_buffer_id_] = result.get();
189 return result; 189 return result;
190 } 190 }
191 191
192 gfx::GpuMemoryBuffer* 192 gfx::GpuMemoryBuffer*
193 TestGpuMemoryBufferManager::GpuMemoryBufferFromClientBuffer( 193 TestGpuMemoryBufferManager::GpuMemoryBufferFromClientBuffer(
194 ClientBuffer buffer) { 194 ClientBuffer buffer) {
195 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer); 195 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer);
196 } 196 }
197 197
198 void TestGpuMemoryBufferManager::SetDestructionSyncToken( 198 void TestGpuMemoryBufferManager::SetDestructionSyncToken(
199 gfx::GpuMemoryBuffer* buffer, 199 gfx::GpuMemoryBuffer* buffer,
200 const gpu::SyncToken& sync_token) {} 200 const gpu::SyncToken& sync_token) {}
201 201
202 } // namespace cc 202 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/remote_proto_channel_bridge.cc ('k') | cc/test/test_layer_tree_host_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698