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 const mojom::GpuService::EstablishGpuChannelCallback& callback) override; |
| 28 |
| 29 void CreateGpuMemoryBuffer( |
| 30 mojom::GpuMemoryBufferIdPtr id, |
| 31 const gfx::Size& size, |
| 32 mojom::BufferFormat format, |
| 33 mojom::BufferUsage usage, |
| 34 uint64_t surface_id, |
| 35 const mojom::GpuService::CreateGpuMemoryBufferCallback& callback) |
| 36 override; |
| 37 |
| 38 void CreateGpuMemoryBufferFromHandle( |
| 39 mojom::GpuMemoryBufferHandlePtr buffer_handle, |
| 40 mojom::GpuMemoryBufferIdPtr id, |
| 41 const gfx::Size& size, |
| 42 mojom::BufferFormat format, |
| 43 const mojom::GpuService::CreateGpuMemoryBufferFromHandleCallback& |
| 44 callback) override; |
| 45 |
| 46 void DestroyGpuMemoryBuffer(mojom::GpuMemoryBufferIdPtr id, |
| 47 const gpu::SyncToken& sync_token) override; |
| 48 |
| 49 private: |
| 50 mojo::StrongBinding<GpuService> binding_; |
| 51 |
| 52 // A unique client id for constructing the GpuChannel. |
| 53 const int32_t client_id_; |
| 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(GpuServiceImpl); |
| 56 }; |
| 57 |
| 58 } // namespace mus |
| 59 |
| 60 #endif // COMPONENTS_MUS_GPU_GPU_SERVICE_IMPL_H_ |
OLD | NEW |