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

Side by Side Diff: services/ui/public/cpp/gpu/mojo_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "services/ui/public/cpp/gpu/mojo_gpu_memory_buffer_manager.h" 5 #include "services/ui/public/cpp/gpu/mojo_gpu_memory_buffer_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 thread_.task_runner()->PostTask( 90 thread_.task_runner()->PostTask(
91 FROM_HERE, 91 FROM_HERE,
92 base::Bind(&MojoGpuMemoryBufferManager::DeletedGpuMemoryBuffer, 92 base::Bind(&MojoGpuMemoryBufferManager::DeletedGpuMemoryBuffer,
93 base::Unretained(this), id, sync_token)); 93 base::Unretained(this), id, sync_token));
94 return; 94 return;
95 } 95 }
96 gpu_service_->DestroyGpuMemoryBuffer(id, sync_token); 96 gpu_service_->DestroyGpuMemoryBuffer(id, sync_token);
97 } 97 }
98 98
99 std::unique_ptr<gfx::GpuMemoryBuffer> 99 std::unique_ptr<gfx::GpuMemoryBuffer>
100 MojoGpuMemoryBufferManager::AllocateGpuMemoryBuffer( 100 MojoGpuMemoryBufferManager::CreateGpuMemoryBuffer(
101 const gfx::Size& size, 101 const gfx::Size& size,
102 gfx::BufferFormat format, 102 gfx::BufferFormat format,
103 gfx::BufferUsage usage, 103 gfx::BufferUsage usage,
104 gpu::SurfaceHandle surface_handle) { 104 gpu::SurfaceHandle surface_handle) {
105 // Note: this can be called from multiple threads at the same time. Some of 105 // Note: this can be called from multiple threads at the same time. Some of
106 // those threads may not have a TaskRunner set. 106 // those threads may not have a TaskRunner set.
107 DCHECK_EQ(gpu::kNullSurfaceHandle, surface_handle); 107 DCHECK_EQ(gpu::kNullSurfaceHandle, surface_handle);
108 CHECK(!thread_.task_runner()->BelongsToCurrentThread()); 108 CHECK(!thread_.task_runner()->BelongsToCurrentThread());
109 gfx::GpuMemoryBufferHandle gmb_handle; 109 gfx::GpuMemoryBufferHandle gmb_handle;
110 base::WaitableEvent wait(base::WaitableEvent::ResetPolicy::AUTOMATIC, 110 base::WaitableEvent wait(base::WaitableEvent::ResetPolicy::AUTOMATIC,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 } 143 }
144 144
145 void MojoGpuMemoryBufferManager::SetDestructionSyncToken( 145 void MojoGpuMemoryBufferManager::SetDestructionSyncToken(
146 gfx::GpuMemoryBuffer* buffer, 146 gfx::GpuMemoryBuffer* buffer,
147 const gpu::SyncToken& sync_token) { 147 const gpu::SyncToken& sync_token) {
148 static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token( 148 static_cast<gpu::GpuMemoryBufferImpl*>(buffer)->set_destruction_sync_token(
149 sync_token); 149 sync_token);
150 } 150 }
151 151
152 } // namespace ui 152 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/public/cpp/gpu/mojo_gpu_memory_buffer_manager.h ('k') | services/ui/surfaces/mus_gpu_memory_buffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698