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

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

Issue 1429213002: Converted video frame and image callbacks to use new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed typo 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
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 "content/common/child_process_messages.h" 7 #include "content/common/child_process_messages.h"
8 #include "content/common/generic_shared_memory_id_generator.h" 8 #include "content/common/generic_shared_memory_id_generator.h"
9 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" 9 #include "content/common/gpu/client/gpu_memory_buffer_impl.h"
10 10
11 namespace content { 11 namespace content {
12 namespace { 12 namespace {
13 13
14 void DeletedGpuMemoryBuffer(ThreadSafeSender* sender, 14 void DeletedGpuMemoryBuffer(ThreadSafeSender* sender,
15 gfx::GpuMemoryBufferId id, 15 gfx::GpuMemoryBufferId id,
16 uint32 sync_point) { 16 const gpu::SyncToken& sync_token) {
17 TRACE_EVENT0("renderer", 17 TRACE_EVENT0("renderer",
18 "ChildGpuMemoryBufferManager::DeletedGpuMemoryBuffer"); 18 "ChildGpuMemoryBufferManager::DeletedGpuMemoryBuffer");
19 sender->Send(new ChildProcessHostMsg_DeletedGpuMemoryBuffer(id, sync_point)); 19 sender->Send(new ChildProcessHostMsg_DeletedGpuMemoryBuffer(id, sync_token));
20 } 20 }
21 21
22 } // namespace 22 } // namespace
23 23
24 ChildGpuMemoryBufferManager::ChildGpuMemoryBufferManager( 24 ChildGpuMemoryBufferManager::ChildGpuMemoryBufferManager(
25 ThreadSafeSender* sender) 25 ThreadSafeSender* sender)
26 : sender_(sender) { 26 : sender_(sender) {
27 } 27 }
28 28
29 ChildGpuMemoryBufferManager::~ChildGpuMemoryBufferManager() { 29 ChildGpuMemoryBufferManager::~ChildGpuMemoryBufferManager() {
(...skipping 15 matching lines...) Expand all
45 content::GetNextGenericSharedMemoryId(), size.width(), size.height(), 45 content::GetNextGenericSharedMemoryId(), size.width(), size.height(),
46 format, usage, &handle); 46 format, usage, &handle);
47 bool success = sender_->Send(message); 47 bool success = sender_->Send(message);
48 if (!success || handle.is_null()) 48 if (!success || handle.is_null())
49 return nullptr; 49 return nullptr;
50 50
51 scoped_ptr<GpuMemoryBufferImpl> buffer(GpuMemoryBufferImpl::CreateFromHandle( 51 scoped_ptr<GpuMemoryBufferImpl> buffer(GpuMemoryBufferImpl::CreateFromHandle(
52 handle, size, format, usage, 52 handle, size, format, usage,
53 base::Bind(&DeletedGpuMemoryBuffer, sender_, handle.id))); 53 base::Bind(&DeletedGpuMemoryBuffer, sender_, handle.id)));
54 if (!buffer) { 54 if (!buffer) {
55 sender_->Send(new ChildProcessHostMsg_DeletedGpuMemoryBuffer(handle.id, 0)); 55 sender_->Send(new ChildProcessHostMsg_DeletedGpuMemoryBuffer(
56 handle.id, gpu::SyncToken()));
56 return nullptr; 57 return nullptr;
57 } 58 }
58 59
59 return buffer.Pass(); 60 return buffer.Pass();
60 } 61 }
61 62
62 scoped_ptr<gfx::GpuMemoryBuffer> 63 scoped_ptr<gfx::GpuMemoryBuffer>
63 ChildGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle( 64 ChildGpuMemoryBufferManager::CreateGpuMemoryBufferFromHandle(
64 const gfx::GpuMemoryBufferHandle& handle, 65 const gfx::GpuMemoryBufferHandle& handle,
65 const gfx::Size& size, 66 const gfx::Size& size,
66 gfx::BufferFormat format) { 67 gfx::BufferFormat format) {
67 NOTIMPLEMENTED(); 68 NOTIMPLEMENTED();
68 return nullptr; 69 return nullptr;
69 } 70 }
70 71
71 gfx::GpuMemoryBuffer* 72 gfx::GpuMemoryBuffer*
72 ChildGpuMemoryBufferManager::GpuMemoryBufferFromClientBuffer( 73 ChildGpuMemoryBufferManager::GpuMemoryBufferFromClientBuffer(
73 ClientBuffer buffer) { 74 ClientBuffer buffer) {
74 return GpuMemoryBufferImpl::FromClientBuffer(buffer); 75 return GpuMemoryBufferImpl::FromClientBuffer(buffer);
75 } 76 }
76 77
77 void ChildGpuMemoryBufferManager::SetDestructionSyncPoint( 78 void ChildGpuMemoryBufferManager::SetDestructionSyncToken(
78 gfx::GpuMemoryBuffer* buffer, 79 gfx::GpuMemoryBuffer* buffer,
79 uint32 sync_point) { 80 const gpu::SyncToken& sync_token) {
80 static_cast<GpuMemoryBufferImpl*>(buffer) 81 static_cast<GpuMemoryBufferImpl*>(buffer)
81 ->set_destruction_sync_point(sync_point); 82 ->set_destruction_sync_token(sync_token);
82 } 83 }
83 84
84 } // namespace content 85 } // namespace content
OLDNEW
« no previous file with comments | « content/child/child_gpu_memory_buffer_manager.h ('k') | content/common/child_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698