| 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 CONTENT_BROWSER_GPU_GPU_CLIENT_H_ |
| 6 #define CONTENT_BROWSER_GPU_GPU_CLIENT_H_ |
| 7 |
| 8 #include "base/memory/weak_ptr.h" |
| 9 #include "ipc/ipc_channel_handle.h" |
| 10 #include "mojo/public/cpp/bindings/binding_set.h" |
| 11 #include "services/ui/public/interfaces/gpu.mojom.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 class GpuClient : public ui::mojom::Gpu { |
| 16 public: |
| 17 explicit GpuClient(int render_process_id); |
| 18 ~GpuClient() override; |
| 19 |
| 20 void Add(ui::mojom::GpuRequest request); |
| 21 |
| 22 private: |
| 23 void OnError(); |
| 24 void OnEstablishGpuChannel(const EstablishGpuChannelCallback& callback, |
| 25 const IPC::ChannelHandle& channel, |
| 26 const gpu::GPUInfo& gpu_info); |
| 27 void OnCreateGpuMemoryBuffer(const CreateGpuMemoryBufferCallback& callback, |
| 28 const gfx::GpuMemoryBufferHandle& handle); |
| 29 |
| 30 // ui::mojom::Gpu overrides: |
| 31 void EstablishGpuChannel( |
| 32 const EstablishGpuChannelCallback& callback) override; |
| 33 void CreateGpuMemoryBuffer( |
| 34 gfx::GpuMemoryBufferId id, |
| 35 const gfx::Size& size, |
| 36 gfx::BufferFormat format, |
| 37 gfx::BufferUsage usage, |
| 38 const ui::mojom::Gpu::CreateGpuMemoryBufferCallback& callback) override; |
| 39 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
| 40 const gpu::SyncToken& sync_token) override; |
| 41 |
| 42 const int render_process_id_; |
| 43 mojo::BindingSet<ui::mojom::Gpu> bindings_; |
| 44 base::WeakPtrFactory<GpuClient> weak_factory_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(GpuClient); |
| 47 }; |
| 48 |
| 49 } // namespace content |
| 50 |
| 51 #endif // CONTENT_BROWSER_GPU_GPU_CLIENT_H_ |
| OLD | NEW |