Chromium Code Reviews| Index: components/mus/gpu/gpu_service_impl.cc |
| diff --git a/components/mus/gpu/gpu_service_impl.cc b/components/mus/gpu/gpu_service_impl.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..df1d53e04da9e4c98cc70262807e516980832eef |
| --- /dev/null |
| +++ b/components/mus/gpu/gpu_service_impl.cc |
| @@ -0,0 +1,63 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "components/mus/gpu/gpu_service_impl.h" |
| + |
| +#include "components/mus/common/gpu_type_converters.h" |
| +#include "components/mus/gpu/gpu_service_mus.h" |
| +#include "services/shell/public/cpp/connection.h" |
| + |
| +namespace mus { |
| + |
| +GpuServiceImpl::GpuServiceImpl( |
| + mojo::InterfaceRequest<mojom::GpuService> request, |
| + shell::Connection* connection) |
| + : binding_(this, std::move(request)), |
| + 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
|
| + // Make sure client_id is greater than 1, because 1 is used for the local |
| + // GpuChannel. |
| + DCHECK_GT(client_id_, 1); |
| +} |
| + |
| +GpuServiceImpl::~GpuServiceImpl() {} |
| + |
| +void GpuServiceImpl::EstablishGpuChannel( |
| + bool preempts, |
| + bool allow_view_command_buffers, |
| + bool allow_real_time_streams, |
| + const mojom::GpuService::EstablishGpuChannelCallback& callback) { |
| + GpuServiceMus* service = GpuServiceMus::GetInstance(); |
| + IPC::ChannelHandle channel_handle = service->EstablishGpuChannel( |
| + client_id_, client_id_, preempts, allow_view_command_buffers, |
| + 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.
|
| + // TODO(penghuang): Send the GPUInfo to the client. |
| + callback.Run(client_id_, mojom::ChannelHandle::From(channel_handle), nullptr); |
| +} |
| + |
| +void GpuServiceImpl::CreateGpuMemoryBuffer( |
| + mojom::GpuMemoryBufferIdPtr id, |
| + mojo::SizePtr size, |
| + mojom::BufferFormat format, |
| + mojom::BufferUsage usage, |
| + uint64_t surface_id, |
| + const mojom::GpuService::CreateGpuMemoryBufferCallback& callback) { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +void GpuServiceImpl::CreateGpuMemoryBufferFromHandle( |
| + mojom::GpuMemoryBufferHandlePtr buffer_handle, |
| + mojom::GpuMemoryBufferIdPtr id, |
| + mojo::SizePtr size, |
| + mojom::BufferFormat format, |
| + const mojom::GpuService::CreateGpuMemoryBufferFromHandleCallback& |
| + callback) { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +void GpuServiceImpl::DestroyGpuMemoryBuffer(mojom::GpuMemoryBufferIdPtr id, |
| + const gpu::SyncToken& sync_token) { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +} // namespace mus |