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 #ifndef COMPONENTS_MUS_GPU_GPU_SERVICE_IMPL_H_ |
| 6 #define COMPONENTS_MUS_GPU_GPU_SERVICE_IMPL_H_ |
| 7 |
| 8 #include "components/mus/public/interfaces/gpu_memory_buffer.mojom.h" |
| 9 #include "components/mus/public/interfaces/gpu_service.mojom.h" |
| 10 #include "mojo/public/cpp/bindings/interface_request.h" |
| 11 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 12 |
| 13 namespace shell { |
| 14 class Connection; |
| 15 } |
| 16 |
| 17 namespace mus { |
| 18 |
| 19 class GpuServiceImpl : public mojom::GpuService { |
| 20 public: |
| 21 GpuServiceImpl(mojo::InterfaceRequest<mojom::GpuService> request, |
| 22 shell::Connection* connection); |
| 23 ~GpuServiceImpl() override; |
| 24 |
| 25 // mojom::GpuService overrides: |
| 26 void EstablishGpuChannel( |
| 27 bool preempts, |
| 28 bool allow_view_command_buffers, |
| 29 bool allow_real_time_streams, |
| 30 const mojom::GpuService::EstablishGpuChannelCallback& callback) override; |
| 31 |
| 32 void CreateGpuMemoryBuffer( |
| 33 mojom::GpuMemoryBufferIdPtr id, |
| 34 mojo::SizePtr size, |
| 35 mojom::BufferFormat format, |
| 36 mojom::BufferUsage usage, |
| 37 uint64_t surface_id, |
| 38 const mojom::GpuService::CreateGpuMemoryBufferCallback& callback) |
| 39 override; |
| 40 |
| 41 void CreateGpuMemoryBufferFromHandle( |
| 42 mojom::GpuMemoryBufferHandlePtr buffer_handle, |
| 43 mojom::GpuMemoryBufferIdPtr id, |
| 44 mojo::SizePtr size, |
| 45 mojom::BufferFormat format, |
| 46 const mojom::GpuService::CreateGpuMemoryBufferFromHandleCallback& |
| 47 callback) override; |
| 48 |
| 49 void DestroyGpuMemoryBuffer(mojom::GpuMemoryBufferIdPtr id, |
| 50 const gpu::SyncToken& sync_token) override; |
| 51 |
| 52 private: |
| 53 mojo::StrongBinding<GpuService> binding_; |
| 54 const int32_t client_id_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(GpuServiceImpl); |
| 57 }; |
| 58 |
| 59 } // namespace mus |
| 60 |
| 61 #endif // COMPONENTS_MUS_GPU_GPU_SERVICE_IMPL_H_ |
OLD | NEW |