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

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

Issue 2559113002: mus/gpu: Introduce the GpuServiceHost mojom interface. (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_internal.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_INTERNAL_H_
6 #define SERVICES_UI_GPU_GPU_SERVICE_INTERNAL_H_ 6 #define SERVICES_UI_GPU_GPU_SERVICE_INTERNAL_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_service_internal.mojom.h" 25 #include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h"
25 #include "ui/gfx/native_widget_types.h" 26 #include "ui/gfx/native_widget_types.h"
26 27
27 namespace gpu { 28 namespace gpu {
28 class GpuMemoryBufferFactory; 29 class GpuMemoryBufferFactory;
29 class GpuWatchdogThread; 30 class GpuWatchdogThread;
30 class SyncPointManager; 31 class SyncPointManager;
31 } 32 }
32 33
33 namespace media { 34 namespace media {
(...skipping 11 matching lines...) Expand all
45 public mojom::GpuServiceInternal, 46 public mojom::GpuServiceInternal,
46 public base::NonThreadSafe { 47 public base::NonThreadSafe {
47 public: 48 public:
48 GpuServiceInternal(const gpu::GPUInfo& gpu_info, 49 GpuServiceInternal(const gpu::GPUInfo& gpu_info,
49 std::unique_ptr<gpu::GpuWatchdogThread> watchdog, 50 std::unique_ptr<gpu::GpuWatchdogThread> watchdog,
50 gpu::GpuMemoryBufferFactory* memory_buffer_factory, 51 gpu::GpuMemoryBufferFactory* memory_buffer_factory,
51 scoped_refptr<base::SingleThreadTaskRunner> io_runner); 52 scoped_refptr<base::SingleThreadTaskRunner> io_runner);
52 53
53 ~GpuServiceInternal() override; 54 ~GpuServiceInternal() override;
54 55
56 void InitializeWithHost(mojom::GpuServiceHostPtr gpu_host);
55 void Bind(mojom::GpuServiceInternalRequest request); 57 void Bind(mojom::GpuServiceInternalRequest request);
56 58
57 private: 59 private:
58 friend class GpuMain; 60 friend class GpuMain;
59 61
60 gfx::GpuMemoryBufferHandle CreateGpuMemoryBufferFromeHandle( 62 gfx::GpuMemoryBufferHandle CreateGpuMemoryBufferFromeHandle(
61 gfx::GpuMemoryBufferHandle buffer_handle, 63 gfx::GpuMemoryBufferHandle buffer_handle,
62 gfx::GpuMemoryBufferId id, 64 gfx::GpuMemoryBufferId id,
63 const gfx::Size& size, 65 const gfx::Size& size,
64 gfx::BufferFormat format, 66 gfx::BufferFormat format,
(...skipping 22 matching lines...) Expand all
87 const GURL& active_url) override; 89 const GURL& active_url) override;
88 void StoreShaderToDisk(int client_id, 90 void StoreShaderToDisk(int client_id,
89 const std::string& key, 91 const std::string& key,
90 const std::string& shader) override; 92 const std::string& shader) override;
91 #if defined(OS_WIN) 93 #if defined(OS_WIN)
92 void SendAcceleratedSurfaceCreatedChildWindow( 94 void SendAcceleratedSurfaceCreatedChildWindow(
93 gpu::SurfaceHandle parent_window, 95 gpu::SurfaceHandle parent_window,
94 gpu::SurfaceHandle child_window) override; 96 gpu::SurfaceHandle child_window) override;
95 #endif 97 #endif
96 void SetActiveURL(const GURL& url) override; 98 void SetActiveURL(const GURL& url) override;
97 void Initialize();
98 99
99 // mojom::GpuServiceInternal: 100 // mojom::GpuServiceInternal:
100 void EstablishGpuChannel( 101 void EstablishGpuChannel(
101 int32_t client_id, 102 int32_t client_id,
102 uint64_t client_tracing_id, 103 uint64_t client_tracing_id,
103 bool is_gpu_host, 104 bool is_gpu_host,
104 const EstablishGpuChannelCallback& callback) override; 105 const EstablishGpuChannelCallback& callback) override;
105 void CreateGpuMemoryBuffer( 106 void CreateGpuMemoryBuffer(
106 gfx::GpuMemoryBufferId id, 107 gfx::GpuMemoryBufferId id,
107 const gfx::Size& size, 108 const gfx::Size& size,
(...skipping 13 matching lines...) Expand all
121 122
122 std::unique_ptr<gpu::GpuWatchdogThread> watchdog_thread_; 123 std::unique_ptr<gpu::GpuWatchdogThread> watchdog_thread_;
123 124
124 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory_; 125 gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory_;
125 126
126 gpu::GpuPreferences gpu_preferences_; 127 gpu::GpuPreferences gpu_preferences_;
127 128
128 // Information about the GPU, such as device and vendor ID. 129 // Information about the GPU, such as device and vendor ID.
129 gpu::GPUInfo gpu_info_; 130 gpu::GPUInfo gpu_info_;
130 131
132 mojom::GpuServiceHostPtr gpu_host_;
131 std::unique_ptr<gpu::SyncPointManager> owned_sync_point_manager_; 133 std::unique_ptr<gpu::SyncPointManager> owned_sync_point_manager_;
132 std::unique_ptr<gpu::GpuChannelManager> gpu_channel_manager_; 134 std::unique_ptr<gpu::GpuChannelManager> gpu_channel_manager_;
133 std::unique_ptr<media::MediaGpuChannelManager> media_gpu_channel_manager_; 135 std::unique_ptr<media::MediaGpuChannelManager> media_gpu_channel_manager_;
134 mojo::BindingSet<mojom::GpuServiceInternal> bindings_; 136 mojo::BindingSet<mojom::GpuServiceInternal> bindings_;
135 137
136 DISALLOW_COPY_AND_ASSIGN(GpuServiceInternal); 138 DISALLOW_COPY_AND_ASSIGN(GpuServiceInternal);
137 }; 139 };
138 140
139 } // namespace ui 141 } // namespace ui
140 142
141 #endif // SERVICES_UI_GPU_GPU_SERVICE_INTERNAL_H_ 143 #endif // SERVICES_UI_GPU_GPU_SERVICE_INTERNAL_H_
OLDNEW
« no previous file with comments | « services/ui/gpu/gpu_main.cc ('k') | services/ui/gpu/gpu_service_internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698