Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: services/ui/ws/mus_gpu_memory_buffer_manager.h

Issue 2360203003: services/ui: Add mojom API for creating/destroying gpu memory buffer. (Closed)
Patch Set: . Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/ws/gpu_service_proxy.cc ('k') | services/ui/ws/mus_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SERVICES_UI_WS_MUS_GPU_MEMORY_BUFFER_MANAGER_H_ 5 #ifndef SERVICES_UI_WS_MUS_GPU_MEMORY_BUFFER_MANAGER_H_
6 #define SERVICES_UI_WS_MUS_GPU_MEMORY_BUFFER_MANAGER_H_ 6 #define SERVICES_UI_WS_MUS_GPU_MEMORY_BUFFER_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" 12 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
13 13
14 namespace ui { 14 namespace ui {
15 15
16 namespace mojom {
16 class GpuServiceInternal; 17 class GpuServiceInternal;
18 }
17 19
18 namespace ws { 20 namespace ws {
19 21
20 // This GpuMemoryBufferManager is for establishing a GpuChannelHost used by 22 // This GpuMemoryBufferManager is for establishing a GpuChannelHost used by
21 // mus locally. 23 // mus locally.
22 class MusGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager { 24 class MusGpuMemoryBufferManager : public gpu::GpuMemoryBufferManager {
23 public: 25 public:
24 MusGpuMemoryBufferManager(GpuServiceInternal* gpu_service, int client_id); 26 MusGpuMemoryBufferManager(mojom::GpuServiceInternal* gpu_service,
27 int client_id);
25 ~MusGpuMemoryBufferManager() override; 28 ~MusGpuMemoryBufferManager() override;
26 29
27 // Overridden from gpu::GpuMemoryBufferManager: 30 // Overridden from gpu::GpuMemoryBufferManager:
28 std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer( 31 std::unique_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBuffer(
29 const gfx::Size& size, 32 const gfx::Size& size,
30 gfx::BufferFormat format, 33 gfx::BufferFormat format,
31 gfx::BufferUsage usage, 34 gfx::BufferUsage usage,
32 gpu::SurfaceHandle surface_handle) override; 35 gpu::SurfaceHandle surface_handle) override;
33 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle( 36 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBufferFromHandle(
34 const gfx::GpuMemoryBufferHandle& handle, 37 const gfx::GpuMemoryBufferHandle& handle,
35 const gfx::Size& size, 38 const gfx::Size& size,
36 gfx::BufferFormat format) override; 39 gfx::BufferFormat format) override;
37 gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer( 40 gfx::GpuMemoryBuffer* GpuMemoryBufferFromClientBuffer(
38 ClientBuffer buffer) override; 41 ClientBuffer buffer) override;
39 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer, 42 void SetDestructionSyncToken(gfx::GpuMemoryBuffer* buffer,
40 const gpu::SyncToken& sync_token) override; 43 const gpu::SyncToken& sync_token) override;
41 44
42 private: 45 private:
43 DISALLOW_COPY_AND_ASSIGN(MusGpuMemoryBufferManager); 46 DISALLOW_COPY_AND_ASSIGN(MusGpuMemoryBufferManager);
44 47
45 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, 48 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
46 int client_id, 49 int client_id,
47 bool is_native, 50 bool is_native,
48 const gpu::SyncToken& sync_token); 51 const gpu::SyncToken& sync_token);
49 52
50 GpuServiceInternal* gpu_service_; 53 mojom::GpuServiceInternal* gpu_service_;
51 const int client_id_; 54 const int client_id_;
52 base::WeakPtrFactory<MusGpuMemoryBufferManager> weak_factory_; 55 base::WeakPtrFactory<MusGpuMemoryBufferManager> weak_factory_;
53 }; 56 };
54 57
55 } // namespace ws 58 } // namespace ws
56 } // namespace ui 59 } // namespace ui
57 60
58 #endif // SERVICES_UI_WS_MUS_GPU_MEMORY_BUFFER_MANAGER_H_ 61 #endif // SERVICES_UI_WS_MUS_GPU_MEMORY_BUFFER_MANAGER_H_
OLDNEW
« no previous file with comments | « services/ui/ws/gpu_service_proxy.cc ('k') | services/ui/ws/mus_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698