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

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

Issue 1403283007: Re-land: ui: Add custom stride support to GLImageMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more missing static_casts Created 5 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
« no previous file with comments | « components/mus/gles2/mojo_gpu_memory_buffer.cc ('k') | content/common/child_process_messages.h » ('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 "content/browser/gpu/browser_gpu_memory_buffer_manager.h" 5 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 // Allocate shared memory buffer. 539 // Allocate shared memory buffer.
540 auto insert_result = buffers.insert(std::make_pair( 540 auto insert_result = buffers.insert(std::make_pair(
541 new_id, BufferInfo(request->size, gfx::SHARED_MEMORY_BUFFER, 541 new_id, BufferInfo(request->size, gfx::SHARED_MEMORY_BUFFER,
542 request->format, request->usage, 0))); 542 request->format, request->usage, 0)));
543 DCHECK(insert_result.second); 543 DCHECK(insert_result.second);
544 544
545 gfx::GpuMemoryBufferHandle handle; 545 gfx::GpuMemoryBufferHandle handle;
546 handle.id = new_id; 546 handle.id = new_id;
547 handle.handle = request->handle.handle; 547 handle.handle = request->handle.handle;
548 handle.offset = request->handle.offset; 548 handle.offset = request->handle.offset;
549 handle.stride = request->handle.stride;
549 550
550 // Note: Unretained is safe as IO thread is stopped before manager is 551 // Note: Unretained is safe as IO thread is stopped before manager is
551 // destroyed. 552 // destroyed.
552 request->result = GpuMemoryBufferImplSharedMemory::CreateFromHandle( 553 request->result = GpuMemoryBufferImplSharedMemory::CreateFromHandle(
553 handle, request->size, request->format, request->usage, 554 handle, request->size, request->format, request->usage,
554 base::Bind( 555 base::Bind(
555 &GpuMemoryBufferDeleted, 556 &GpuMemoryBufferDeleted,
556 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), 557 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
557 base::Bind(&BrowserGpuMemoryBufferManager::DestroyGpuMemoryBufferOnIO, 558 base::Bind(&BrowserGpuMemoryBufferManager::DestroyGpuMemoryBufferOnIO,
558 base::Unretained(this), new_id, request->client_id))); 559 base::Unretained(this), new_id, request->client_id)));
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 return gpu_client_tracing_id_; 743 return gpu_client_tracing_id_;
743 } 744 }
744 745
745 // In normal cases, |client_id| is a child process id, so we can perform 746 // In normal cases, |client_id| is a child process id, so we can perform
746 // the standard conversion. 747 // the standard conversion.
747 return ChildProcessHostImpl::ChildProcessUniqueIdToTracingProcessId( 748 return ChildProcessHostImpl::ChildProcessUniqueIdToTracingProcessId(
748 client_id); 749 client_id);
749 } 750 }
750 751
751 } // namespace content 752 } // namespace content
OLDNEW
« no previous file with comments | « components/mus/gles2/mojo_gpu_memory_buffer.cc ('k') | content/common/child_process_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698