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

Side by Side Diff: services/ui/surfaces/mus_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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/surfaces/mus_gpu_memory_buffer_manager.h" 5 #include "services/ui/surfaces/mus_gpu_memory_buffer_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "gpu/ipc/client/gpu_memory_buffer_impl.h" 8 #include "gpu/ipc/client/gpu_memory_buffer_impl.h"
9 #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h" 9 #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h"
10 #include "gpu/ipc/common/gpu_memory_buffer_support.h" 10 #include "gpu/ipc/common/gpu_memory_buffer_support.h"
11 #include "services/ui/common/generic_shared_memory_id_generator.h" 11 #include "services/ui/common/generic_shared_memory_id_generator.h"
12 #include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h" 12 #include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h"
13 13
14 namespace ui { 14 namespace ui {
15 15
16 MusGpuMemoryBufferManager::MusGpuMemoryBufferManager( 16 MusGpuMemoryBufferManager::MusGpuMemoryBufferManager(
17 mojom::GpuServiceInternalPtr gpu_service, 17 mojom::GpuServiceInternalPtr gpu_service,
18 int client_id) 18 int client_id)
19 : gpu_service_(std::move(gpu_service)), 19 : gpu_service_(std::move(gpu_service)),
20 client_id_(client_id), 20 client_id_(client_id),
21 weak_factory_(this) {} 21 weak_factory_(this) {}
22 22
23 MusGpuMemoryBufferManager::~MusGpuMemoryBufferManager() {} 23 MusGpuMemoryBufferManager::~MusGpuMemoryBufferManager() {}
24 24
25 std::unique_ptr<gfx::GpuMemoryBuffer> 25 std::unique_ptr<gfx::GpuMemoryBuffer>
26 MusGpuMemoryBufferManager::AllocateGpuMemoryBuffer( 26 MusGpuMemoryBufferManager::CreateGpuMemoryBuffer(
27 const gfx::Size& size, 27 const gfx::Size& size,
28 gfx::BufferFormat format, 28 gfx::BufferFormat format,
29 gfx::BufferUsage usage, 29 gfx::BufferUsage usage,
30 gpu::SurfaceHandle surface_handle) { 30 gpu::SurfaceHandle surface_handle) {
31 gfx::GpuMemoryBufferId id = GetNextGenericSharedMemoryId(); 31 gfx::GpuMemoryBufferId id = GetNextGenericSharedMemoryId();
32 const bool is_native = 32 const bool is_native =
33 gpu::IsNativeGpuMemoryBufferConfigurationSupported(format, usage); 33 gpu::IsNativeGpuMemoryBufferConfigurationSupported(format, usage);
34 if (is_native) { 34 if (is_native) {
35 gfx::GpuMemoryBufferHandle handle; 35 gfx::GpuMemoryBufferHandle handle;
36 gpu_service_->CreateGpuMemoryBuffer(id, size, format, usage, client_id_, 36 gpu_service_->CreateGpuMemoryBuffer(id, size, format, usage, client_id_,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 gfx::GpuMemoryBufferId id, 71 gfx::GpuMemoryBufferId id,
72 int client_id, 72 int client_id,
73 bool is_native, 73 bool is_native,
74 const gpu::SyncToken& sync_token) { 74 const gpu::SyncToken& sync_token) {
75 if (is_native) { 75 if (is_native) {
76 gpu_service_->DestroyGpuMemoryBuffer(id, client_id, sync_token); 76 gpu_service_->DestroyGpuMemoryBuffer(id, client_id, sync_token);
77 } 77 }
78 } 78 }
79 79
80 } // namespace ui 80 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/surfaces/mus_gpu_memory_buffer_manager.h ('k') | services/ui/ws/gpu_service_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698