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

Side by Side Diff: content/browser/gpu/browser_gpu_memory_buffer_manager.cc

Issue 2526683002: gpu: Rename AllocateGpuMemoryBuffer to CreateGpuMemoryBuffer. (Closed)
Patch Set: . Created 4 years 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 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 "content/browser/gpu/browser_gpu_memory_buffer_manager.h" 5 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 case gfx::EMPTY_BUFFER: 209 case gfx::EMPTY_BUFFER:
210 NOTREACHED(); 210 NOTREACHED();
211 return GL_TEXTURE_2D; 211 return GL_TEXTURE_2D;
212 } 212 }
213 213
214 NOTREACHED(); 214 NOTREACHED();
215 return GL_TEXTURE_2D; 215 return GL_TEXTURE_2D;
216 } 216 }
217 217
218 std::unique_ptr<gfx::GpuMemoryBuffer> 218 std::unique_ptr<gfx::GpuMemoryBuffer>
219 BrowserGpuMemoryBufferManager::AllocateGpuMemoryBuffer( 219 BrowserGpuMemoryBufferManager::CreateGpuMemoryBuffer(
220 const gfx::Size& size, 220 const gfx::Size& size,
221 gfx::BufferFormat format, 221 gfx::BufferFormat format,
222 gfx::BufferUsage usage, 222 gfx::BufferUsage usage,
223 gpu::SurfaceHandle surface_handle) { 223 gpu::SurfaceHandle surface_handle) {
224 return AllocateGpuMemoryBufferForSurface(size, format, usage, surface_handle); 224 return AllocateGpuMemoryBufferForSurface(size, format, usage, surface_handle);
225 } 225 }
226 226
227 std::unique_ptr<gfx::GpuMemoryBuffer> 227 std::unique_ptr<gfx::GpuMemoryBuffer>
228 BrowserGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle( 228 BrowserGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle(
229 const gfx::GpuMemoryBufferHandle& handle, 229 const gfx::GpuMemoryBufferHandle& handle,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 // Allocate shared memory buffer as fallback. 279 // Allocate shared memory buffer as fallback.
280 auto insert_result = buffers.insert(std::make_pair( 280 auto insert_result = buffers.insert(std::make_pair(
281 id, BufferInfo(size, gfx::SHARED_MEMORY_BUFFER, format, usage, 0))); 281 id, BufferInfo(size, gfx::SHARED_MEMORY_BUFFER, format, usage, 0)));
282 if (!insert_result.second) { 282 if (!insert_result.second) {
283 DLOG(ERROR) << "Child process attempted to allocate a GpuMemoryBuffer with " 283 DLOG(ERROR) << "Child process attempted to allocate a GpuMemoryBuffer with "
284 "an existing ID."; 284 "an existing ID.";
285 callback.Run(gfx::GpuMemoryBufferHandle()); 285 callback.Run(gfx::GpuMemoryBufferHandle());
286 return; 286 return;
287 } 287 }
288 288
289 callback.Run(gpu::GpuMemoryBufferImplSharedMemory::AllocateGpuMemoryBuffer( 289 callback.Run(gpu::GpuMemoryBufferImplSharedMemory::CreateGpuMemoryBuffer(
290 id, size, format)); 290 id, size, format));
291 } 291 }
292 292
293 void BrowserGpuMemoryBufferManager::SetDestructionSyncToken( 293 void BrowserGpuMemoryBufferManager::SetDestructionSyncToken(
294 gfx::GpuMemoryBuffer* buffer, 294 gfx::GpuMemoryBuffer* buffer,
295 const gpu::SyncToken& sync_token) { 295 const gpu::SyncToken& sync_token) {
296 static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token( 296 static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token(
297 sync_token); 297 sync_token);
298 } 298 }
299 299
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 format(format), 676 format(format),
677 usage(usage), 677 usage(usage),
678 gpu_host_id(gpu_host_id) {} 678 gpu_host_id(gpu_host_id) {}
679 679
680 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) = 680 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) =
681 default; 681 default;
682 682
683 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {} 683 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {}
684 684
685 } // namespace content 685 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/browser_gpu_memory_buffer_manager.h ('k') | content/child/child_gpu_memory_buffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698