Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/mus/gpu/gpu_service_impl.h" | |
| 6 | |
| 7 #include "components/mus/common/gpu_type_converters.h" | |
| 8 #include "components/mus/gpu/gpu_service_mus.h" | |
| 9 #include "services/shell/public/cpp/connection.h" | |
| 10 | |
| 11 namespace mus { | |
| 12 | |
| 13 GpuServiceImpl::GpuServiceImpl( | |
| 14 mojo::InterfaceRequest<mojom::GpuService> request, | |
| 15 shell::Connection* connection) | |
| 16 : binding_(this, std::move(request)), | |
| 17 client_id_(connection->GetRemoteInstanceID() + 1) { | |
|
Fady Samuel
2016/05/25 17:06:47
What is this client ID? A comment would be helpful
Peng
2016/05/25 19:42:55
The unique client id is for constructing the GpuCh
| |
| 18 // Make sure client_id is greater than 1, because 1 is used for the local | |
| 19 // GpuChannel. | |
| 20 DCHECK_GT(client_id_, 1); | |
| 21 } | |
| 22 | |
| 23 GpuServiceImpl::~GpuServiceImpl() {} | |
| 24 | |
| 25 void GpuServiceImpl::EstablishGpuChannel( | |
| 26 bool preempts, | |
| 27 bool allow_view_command_buffers, | |
| 28 bool allow_real_time_streams, | |
| 29 const mojom::GpuService::EstablishGpuChannelCallback& callback) { | |
| 30 GpuServiceMus* service = GpuServiceMus::GetInstance(); | |
| 31 IPC::ChannelHandle channel_handle = service->EstablishGpuChannel( | |
| 32 client_id_, client_id_, preempts, allow_view_command_buffers, | |
| 33 allow_real_time_streams); | |
|
piman
2016/05/24 22:46:53
I think it would be preferable to have EstablishGp
Peng
2016/05/25 19:42:55
Done.
| |
| 34 // TODO(penghuang): Send the GPUInfo to the client. | |
| 35 callback.Run(client_id_, mojom::ChannelHandle::From(channel_handle), nullptr); | |
| 36 } | |
| 37 | |
| 38 void GpuServiceImpl::CreateGpuMemoryBuffer( | |
| 39 mojom::GpuMemoryBufferIdPtr id, | |
| 40 mojo::SizePtr size, | |
| 41 mojom::BufferFormat format, | |
| 42 mojom::BufferUsage usage, | |
| 43 uint64_t surface_id, | |
| 44 const mojom::GpuService::CreateGpuMemoryBufferCallback& callback) { | |
| 45 NOTIMPLEMENTED(); | |
| 46 } | |
| 47 | |
| 48 void GpuServiceImpl::CreateGpuMemoryBufferFromHandle( | |
| 49 mojom::GpuMemoryBufferHandlePtr buffer_handle, | |
| 50 mojom::GpuMemoryBufferIdPtr id, | |
| 51 mojo::SizePtr size, | |
| 52 mojom::BufferFormat format, | |
| 53 const mojom::GpuService::CreateGpuMemoryBufferFromHandleCallback& | |
| 54 callback) { | |
| 55 NOTIMPLEMENTED(); | |
| 56 } | |
| 57 | |
| 58 void GpuServiceImpl::DestroyGpuMemoryBuffer(mojom::GpuMemoryBufferIdPtr id, | |
| 59 const gpu::SyncToken& sync_token) { | |
| 60 NOTIMPLEMENTED(); | |
| 61 } | |
| 62 | |
| 63 } // namespace mus | |
| OLD | NEW |