| OLD | NEW |
| 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/ws/gpu_service_proxy.h" | 5 #include "services/ui/ws/gpu_service_proxy.h" |
| 6 | 6 |
| 7 #include "base/memory/shared_memory.h" | 7 #include "base/memory/shared_memory.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // id. | 86 // id. |
| 87 const uint64_t client_tracing_id = 0; | 87 const uint64_t client_tracing_id = 0; |
| 88 constexpr bool is_gpu_host = false; | 88 constexpr bool is_gpu_host = false; |
| 89 gpu_service_->EstablishGpuChannel( | 89 gpu_service_->EstablishGpuChannel( |
| 90 client_id, client_tracing_id, is_gpu_host, | 90 client_id, client_tracing_id, is_gpu_host, |
| 91 base::Bind(&GpuServiceProxy::OnGpuChannelEstablished, | 91 base::Bind(&GpuServiceProxy::OnGpuChannelEstablished, |
| 92 base::Unretained(this), callback, client_id)); | 92 base::Unretained(this), callback, client_id)); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void GpuServiceProxy::CreateGpuMemoryBuffer( | 95 void GpuServiceProxy::CreateGpuMemoryBuffer( |
| 96 mojom::GpuMemoryBufferIdPtr id, | 96 gfx::GpuMemoryBufferId id, |
| 97 const gfx::Size& size, | 97 const gfx::Size& size, |
| 98 gfx::BufferFormat format, | 98 gfx::BufferFormat format, |
| 99 gfx::BufferUsage usage, | 99 gfx::BufferUsage usage, |
| 100 uint64_t surface_id, | 100 uint64_t surface_id, |
| 101 const mojom::GpuService::CreateGpuMemoryBufferCallback& callback) { | 101 const mojom::GpuService::CreateGpuMemoryBufferCallback& callback) { |
| 102 NOTIMPLEMENTED(); | 102 NOTIMPLEMENTED(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void GpuServiceProxy::DestroyGpuMemoryBuffer(mojom::GpuMemoryBufferIdPtr id, | 105 void GpuServiceProxy::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
| 106 const gpu::SyncToken& sync_token) { | 106 const gpu::SyncToken& sync_token) { |
| 107 NOTIMPLEMENTED(); | 107 NOTIMPLEMENTED(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 bool GpuServiceProxy::IsMainThread() { | 110 bool GpuServiceProxy::IsMainThread() { |
| 111 return main_thread_task_runner_->BelongsToCurrentThread(); | 111 return main_thread_task_runner_->BelongsToCurrentThread(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 scoped_refptr<base::SingleThreadTaskRunner> | 114 scoped_refptr<base::SingleThreadTaskRunner> |
| 115 GpuServiceProxy::GetIOThreadTaskRunner() { | 115 GpuServiceProxy::GetIOThreadTaskRunner() { |
| 116 return io_thread_->task_runner(); | 116 return io_thread_->task_runner(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 std::unique_ptr<base::SharedMemory> GpuServiceProxy::AllocateSharedMemory( | 119 std::unique_ptr<base::SharedMemory> GpuServiceProxy::AllocateSharedMemory( |
| 120 size_t size) { | 120 size_t size) { |
| 121 std::unique_ptr<base::SharedMemory> shm(new base::SharedMemory()); | 121 std::unique_ptr<base::SharedMemory> shm(new base::SharedMemory()); |
| 122 if (!shm->CreateAnonymous(size)) | 122 if (!shm->CreateAnonymous(size)) |
| 123 shm.reset(); | 123 shm.reset(); |
| 124 return shm; | 124 return shm; |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace ws | 127 } // namespace ws |
| 128 } // namespace ui | 128 } // namespace ui |
| OLD | NEW |