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

Side by Side Diff: content/child/child_gpu_memory_buffer_manager.cc

Issue 1827123002: Move content/common/gpu/client to gpu/ipc/client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 8 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 | « content/child/BUILD.gn ('k') | content/child/child_thread_impl_browsertest.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 "content/child/child_gpu_memory_buffer_manager.h" 5 #include "content/child/child_gpu_memory_buffer_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/common/child_process_messages.h" 9 #include "content/common/child_process_messages.h"
10 #include "content/common/generic_shared_memory_id_generator.h" 10 #include "content/common/generic_shared_memory_id_generator.h"
11 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" 11 #include "gpu/ipc/client/gpu_memory_buffer_impl.h"
12 12
13 namespace content { 13 namespace content {
14 namespace { 14 namespace {
15 15
16 void DeletedGpuMemoryBuffer(ThreadSafeSender* sender, 16 void DeletedGpuMemoryBuffer(ThreadSafeSender* sender,
17 gfx::GpuMemoryBufferId id, 17 gfx::GpuMemoryBufferId id,
18 const gpu::SyncToken& sync_token) { 18 const gpu::SyncToken& sync_token) {
19 TRACE_EVENT0("renderer", 19 TRACE_EVENT0("renderer",
20 "ChildGpuMemoryBufferManager::DeletedGpuMemoryBuffer"); 20 "ChildGpuMemoryBufferManager::DeletedGpuMemoryBuffer");
21 sender->Send(new ChildProcessHostMsg_DeletedGpuMemoryBuffer(id, sync_token)); 21 sender->Send(new ChildProcessHostMsg_DeletedGpuMemoryBuffer(id, sync_token));
(...skipping 21 matching lines...) Expand all
43 size.height()); 43 size.height());
44 44
45 gfx::GpuMemoryBufferHandle handle; 45 gfx::GpuMemoryBufferHandle handle;
46 IPC::Message* message = new ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer( 46 IPC::Message* message = new ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer(
47 content::GetNextGenericSharedMemoryId(), size.width(), size.height(), 47 content::GetNextGenericSharedMemoryId(), size.width(), size.height(),
48 format, usage, &handle); 48 format, usage, &handle);
49 bool success = sender_->Send(message); 49 bool success = sender_->Send(message);
50 if (!success || handle.is_null()) 50 if (!success || handle.is_null())
51 return nullptr; 51 return nullptr;
52 52
53 scoped_ptr<GpuMemoryBufferImpl> buffer(GpuMemoryBufferImpl::CreateFromHandle( 53 scoped_ptr<gpu::GpuMemoryBufferImpl> buffer(
54 handle, size, format, usage, 54 gpu::GpuMemoryBufferImpl::CreateFromHandle(
55 base::Bind(&DeletedGpuMemoryBuffer, base::RetainedRef(sender_), 55 handle, size, format, usage,
56 handle.id))); 56 base::Bind(&DeletedGpuMemoryBuffer, base::RetainedRef(sender_),
57 handle.id)));
57 if (!buffer) { 58 if (!buffer) {
58 sender_->Send(new ChildProcessHostMsg_DeletedGpuMemoryBuffer( 59 sender_->Send(new ChildProcessHostMsg_DeletedGpuMemoryBuffer(
59 handle.id, gpu::SyncToken())); 60 handle.id, gpu::SyncToken()));
60 return nullptr; 61 return nullptr;
61 } 62 }
62 63
63 return std::move(buffer); 64 return std::move(buffer);
64 } 65 }
65 66
66 scoped_ptr<gfx::GpuMemoryBuffer> 67 scoped_ptr<gfx::GpuMemoryBuffer>
67 ChildGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle( 68 ChildGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle(
68 const gfx::GpuMemoryBufferHandle& handle, 69 const gfx::GpuMemoryBufferHandle& handle,
69 const gfx::Size& size, 70 const gfx::Size& size,
70 gfx::BufferFormat format) { 71 gfx::BufferFormat format) {
71 NOTIMPLEMENTED(); 72 NOTIMPLEMENTED();
72 return nullptr; 73 return nullptr;
73 } 74 }
74 75
75 gfx::GpuMemoryBuffer* 76 gfx::GpuMemoryBuffer*
76 ChildGpuMemoryBufferManager::GpuMemoryBufferFromClientBuffer( 77 ChildGpuMemoryBufferManager::GpuMemoryBufferFromClientBuffer(
77 ClientBuffer buffer) { 78 ClientBuffer buffer) {
78 return GpuMemoryBufferImpl::FromClientBuffer(buffer); 79 return gpu::GpuMemoryBufferImpl::FromClientBuffer(buffer);
79 } 80 }
80 81
81 void ChildGpuMemoryBufferManager::SetDestructionSyncToken( 82 void ChildGpuMemoryBufferManager::SetDestructionSyncToken(
82 gfx::GpuMemoryBuffer* buffer, 83 gfx::GpuMemoryBuffer* buffer,
83 const gpu::SyncToken& sync_token) { 84 const gpu::SyncToken& sync_token) {
84 static_cast<GpuMemoryBufferImpl*>(buffer) 85 static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token(
85 ->set_destruction_sync_token(sync_token); 86 sync_token);
86 } 87 }
87 88
88 } // namespace content 89 } // namespace content
OLDNEW
« no previous file with comments | « content/child/BUILD.gn ('k') | content/child/child_thread_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698