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

Side by Side Diff: services/ui/gpu/gpu_service.h

Issue 2559183003: mus: More gpu-related renames. (Closed)
Patch Set: . Created 4 years 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/gpu/gpu_main.cc ('k') | services/ui/gpu/gpu_service.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_GPU_GPU_SERVICE_INTERNAL_H_ 5 #ifndef SERVICES_UI_GPU_GPU_SERVICE_H_
6 #define SERVICES_UI_GPU_GPU_SERVICE_INTERNAL_H_ 6 #define SERVICES_UI_GPU_GPU_SERVICE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "base/threading/non_thread_safe.h" 10 #include "base/threading/non_thread_safe.h"
11 #include "base/threading/thread.h" 11 #include "base/threading/thread.h"
12 #include "build/build_config.h" 12 #include "build/build_config.h"
13 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" 13 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
14 #include "gpu/command_buffer/service/gpu_preferences.h" 14 #include "gpu/command_buffer/service/gpu_preferences.h"
15 #include "gpu/config/gpu_info.h" 15 #include "gpu/config/gpu_info.h"
16 #include "gpu/ipc/common/surface_handle.h" 16 #include "gpu/ipc/common/surface_handle.h"
17 #include "gpu/ipc/service/gpu_channel.h" 17 #include "gpu/ipc/service/gpu_channel.h"
18 #include "gpu/ipc/service/gpu_channel_manager.h" 18 #include "gpu/ipc/service/gpu_channel_manager.h"
19 #include "gpu/ipc/service/gpu_channel_manager_delegate.h" 19 #include "gpu/ipc/service/gpu_channel_manager_delegate.h"
20 #include "gpu/ipc/service/gpu_config.h" 20 #include "gpu/ipc/service/gpu_config.h"
21 #include "gpu/ipc/service/x_util.h" 21 #include "gpu/ipc/service/x_util.h"
22 #include "mojo/public/cpp/bindings/binding.h" 22 #include "mojo/public/cpp/bindings/binding.h"
23 #include "mojo/public/cpp/bindings/binding_set.h" 23 #include "mojo/public/cpp/bindings/binding_set.h"
24 #include "services/ui/gpu/interfaces/gpu_service_host.mojom.h" 24 #include "services/ui/gpu/interfaces/gpu_host.mojom.h"
25 #include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h" 25 #include "services/ui/gpu/interfaces/gpu_service.mojom.h"
26 #include "ui/gfx/native_widget_types.h" 26 #include "ui/gfx/native_widget_types.h"
27 27
28 namespace gpu { 28 namespace gpu {
29 class GpuMemoryBufferFactory; 29 class GpuMemoryBufferFactory;
30 class GpuWatchdogThread; 30 class GpuWatchdogThread;
31 class SyncPointManager; 31 class SyncPointManager;
32 } 32 }
33 33
34 namespace media { 34 namespace media {
35 class MediaGpuChannelManager; 35 class MediaGpuChannelManager;
36 } 36 }
37 37
38 namespace ui { 38 namespace ui {
39 39
40 class GpuMain; 40 class GpuMain;
41 41
42 // This runs in the GPU process, and communicates with the gpu host (which is 42 // This runs in the GPU process, and communicates with the gpu host (which is
43 // the window server) over the mojom APIs. This is responsible for setting up 43 // the window server) over the mojom APIs. This is responsible for setting up
44 // the connection to clients, allocating/free'ing gpu memory etc. 44 // the connection to clients, allocating/free'ing gpu memory etc.
45 class GpuServiceInternal : public gpu::GpuChannelManagerDelegate, 45 class GpuService : public gpu::GpuChannelManagerDelegate,
46 public mojom::GpuServiceInternal, 46 public mojom::GpuService,
47 public base::NonThreadSafe { 47 public base::NonThreadSafe {
48 public: 48 public:
49 GpuServiceInternal(const gpu::GPUInfo& gpu_info, 49 GpuService(const gpu::GPUInfo& gpu_info,
50 std::unique_ptr<gpu::GpuWatchdogThread> watchdog, 50 std::unique_ptr<gpu::GpuWatchdogThread> watchdog,
51 gpu::GpuMemoryBufferFactory* memory_buffer_factory, 51 gpu::GpuMemoryBufferFactory* memory_buffer_factory,
52 scoped_refptr<base::SingleThreadTaskRunner> io_runner); 52 scoped_refptr<base::SingleThreadTaskRunner> io_runner);
53 53
54 ~GpuServiceInternal() override; 54 ~GpuService() override;
55 55
56 void InitializeWithHost(mojom::GpuServiceHostPtr gpu_host); 56 void InitializeWithHost(mojom::GpuHostPtr gpu_host);
57 void Bind(mojom::GpuServiceInternalRequest request); 57 void Bind(mojom::GpuServiceRequest request);
58 58
59 private: 59 private:
60 friend class GpuMain; 60 friend class GpuMain;
61 61
62 gfx::GpuMemoryBufferHandle CreateGpuMemoryBufferFromeHandle( 62 gfx::GpuMemoryBufferHandle CreateGpuMemoryBufferFromeHandle(
63 gfx::GpuMemoryBufferHandle buffer_handle, 63 gfx::GpuMemoryBufferHandle buffer_handle,
64 gfx::GpuMemoryBufferId id, 64 gfx::GpuMemoryBufferId id,
65 const gfx::Size& size, 65 const gfx::Size& size,
66 gfx::BufferFormat format, 66 gfx::BufferFormat format,
67 int client_id); 67 int client_id);
(...skipping 22 matching lines...) Expand all
90 void StoreShaderToDisk(int client_id, 90 void StoreShaderToDisk(int client_id,
91 const std::string& key, 91 const std::string& key,
92 const std::string& shader) override; 92 const std::string& shader) override;
93 #if defined(OS_WIN) 93 #if defined(OS_WIN)
94 void SendAcceleratedSurfaceCreatedChildWindow( 94 void SendAcceleratedSurfaceCreatedChildWindow(
95 gpu::SurfaceHandle parent_window, 95 gpu::SurfaceHandle parent_window,
96 gpu::SurfaceHandle child_window) override; 96 gpu::SurfaceHandle child_window) override;
97 #endif 97 #endif
98 void SetActiveURL(const GURL& url) override; 98 void SetActiveURL(const GURL& url) override;
99 99
100 // mojom::GpuServiceInternal: 100 // mojom::GpuService:
101 void EstablishGpuChannel( 101 void EstablishGpuChannel(
102 int32_t client_id, 102 int32_t client_id,
103 uint64_t client_tracing_id, 103 uint64_t client_tracing_id,
104 bool is_gpu_host, 104 bool is_gpu_host,
105 const EstablishGpuChannelCallback& callback) override; 105 const EstablishGpuChannelCallback& callback) override;
106 void CreateGpuMemoryBuffer( 106 void CreateGpuMemoryBuffer(
107 gfx::GpuMemoryBufferId id, 107 gfx::GpuMemoryBufferId id,
108 const gfx::Size& size, 108 const gfx::Size& size,
109 gfx::BufferFormat format, 109 gfx::BufferFormat format,
110 gfx::BufferUsage usage, 110 gfx::BufferUsage usage,
(...skipping 11 matching lines...) Expand all
122 122
123 std::unique_ptr<gpu::GpuWatchdogThread> watchdog_thread_; 123 std::unique_ptr<gpu::GpuWatchdogThread> watchdog_thread_;
124 124
125 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory_; 125 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory_;
126 126
127 gpu::GpuPreferences gpu_preferences_; 127 gpu::GpuPreferences gpu_preferences_;
128 128
129 // Information about the GPU, such as device and vendor ID. 129 // Information about the GPU, such as device and vendor ID.
130 gpu::GPUInfo gpu_info_; 130 gpu::GPUInfo gpu_info_;
131 131
132 mojom::GpuServiceHostPtr gpu_host_; 132 mojom::GpuHostPtr gpu_host_;
133 std::unique_ptr<gpu::SyncPointManager> owned_sync_point_manager_; 133 std::unique_ptr<gpu::SyncPointManager> owned_sync_point_manager_;
134 std::unique_ptr<gpu::GpuChannelManager> gpu_channel_manager_; 134 std::unique_ptr<gpu::GpuChannelManager> gpu_channel_manager_;
135 std::unique_ptr<media::MediaGpuChannelManager> media_gpu_channel_manager_; 135 std::unique_ptr<media::MediaGpuChannelManager> media_gpu_channel_manager_;
136 mojo::BindingSet<mojom::GpuServiceInternal> bindings_; 136 mojo::BindingSet<mojom::GpuService> bindings_;
137 137
138 DISALLOW_COPY_AND_ASSIGN(GpuServiceInternal); 138 DISALLOW_COPY_AND_ASSIGN(GpuService);
139 }; 139 };
140 140
141 } // namespace ui 141 } // namespace ui
142 142
143 #endif // SERVICES_UI_GPU_GPU_SERVICE_INTERNAL_H_ 143 #endif // SERVICES_UI_GPU_GPU_SERVICE_H_
OLDNEW
« no previous file with comments | « services/ui/gpu/gpu_main.cc ('k') | services/ui/gpu/gpu_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698