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

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

Issue 2487783003: gpu: Directly cast ClientBuffer to gfx::GpuMemoryBuffer (Closed)
Patch Set: . Created 4 years, 1 month 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 DLOG(ERROR) << "Child process attempted to allocate a GpuMemoryBuffer with " 284 DLOG(ERROR) << "Child process attempted to allocate a GpuMemoryBuffer with "
285 "an existing ID."; 285 "an existing ID.";
286 callback.Run(gfx::GpuMemoryBufferHandle()); 286 callback.Run(gfx::GpuMemoryBufferHandle());
287 return; 287 return;
288 } 288 }
289 289
290 callback.Run(gpu::GpuMemoryBufferImplSharedMemory::AllocateForChildProcess( 290 callback.Run(gpu::GpuMemoryBufferImplSharedMemory::AllocateForChildProcess(
291 id, size, format, child_process_handle)); 291 id, size, format, child_process_handle));
292 } 292 }
293 293
294 gfx::GpuMemoryBuffer*
295 BrowserGpuMemoryBufferManager::GpuMemoryBufferFromClientBuffer(
296 ClientBuffer buffer) {
297 return gpu::GpuMemoryBufferImpl::FromClientBuffer(buffer);
298 }
299
300 void BrowserGpuMemoryBufferManager::SetDestructionSyncToken( 294 void BrowserGpuMemoryBufferManager::SetDestructionSyncToken(
301 gfx::GpuMemoryBuffer* buffer, 295 gfx::GpuMemoryBuffer* buffer,
302 const gpu::SyncToken& sync_token) { 296 const gpu::SyncToken& sync_token) {
303 static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token( 297 static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token(
304 sync_token); 298 sync_token);
305 } 299 }
306 300
307 bool BrowserGpuMemoryBufferManager::OnMemoryDump( 301 bool BrowserGpuMemoryBufferManager::OnMemoryDump(
308 const base::trace_event::MemoryDumpArgs& args, 302 const base::trace_event::MemoryDumpArgs& args,
309 base::trace_event::ProcessMemoryDump* pmd) { 303 base::trace_event::ProcessMemoryDump* pmd) {
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 format(format), 679 format(format),
686 usage(usage), 680 usage(usage),
687 gpu_host_id(gpu_host_id) {} 681 gpu_host_id(gpu_host_id) {}
688 682
689 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) = 683 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) =
690 default; 684 default;
691 685
692 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {} 686 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {}
693 687
694 } // namespace content 688 } // 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