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

Side by Side Diff: blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.cc

Issue 2250433006: 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 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 "blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h" 5 #include "blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 std::unique_ptr<gfx::GpuMemoryBuffer> 141 std::unique_ptr<gfx::GpuMemoryBuffer>
142 BlimpGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle( 142 BlimpGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle(
143 const gfx::GpuMemoryBufferHandle& handle, 143 const gfx::GpuMemoryBufferHandle& handle,
144 const gfx::Size& size, 144 const gfx::Size& size,
145 gfx::BufferFormat format) { 145 gfx::BufferFormat format) {
146 if (handle.type != gfx::SHARED_MEMORY_BUFFER) 146 if (handle.type != gfx::SHARED_MEMORY_BUFFER)
147 return nullptr; 147 return nullptr;
148 148
149 return base::WrapUnique<gfx::GpuMemoryBuffer>(new GpuMemoryBufferImpl( 149 return base::WrapUnique<gfx::GpuMemoryBuffer>(new GpuMemoryBufferImpl(
150 size, format, 150 size, format, base::MakeUnique<base::SharedMemory>(handle.handle, false),
151 base::WrapUnique(new base::SharedMemory(handle.handle, false)),
152 handle.offset, handle.stride)); 151 handle.offset, handle.stride));
153 } 152 }
154 153
155 gfx::GpuMemoryBuffer* 154 gfx::GpuMemoryBuffer*
156 BlimpGpuMemoryBufferManager::GpuMemoryBufferFromClientBuffer( 155 BlimpGpuMemoryBufferManager::GpuMemoryBufferFromClientBuffer(
157 ClientBuffer buffer) { 156 ClientBuffer buffer) {
158 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer); 157 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer);
159 } 158 }
160 159
161 void BlimpGpuMemoryBufferManager::SetDestructionSyncToken( 160 void BlimpGpuMemoryBufferManager::SetDestructionSyncToken(
162 gfx::GpuMemoryBuffer* buffer, 161 gfx::GpuMemoryBuffer* buffer,
163 const gpu::SyncToken& sync_token) { 162 const gpu::SyncToken& sync_token) {
164 NOTIMPLEMENTED(); 163 NOTIMPLEMENTED();
165 } 164 }
166 165
167 } // namespace client 166 } // namespace client
168 } // namespace blimp 167 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698