OLD | NEW |
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_H_ | 5 #ifndef SERVICES_UI_GPU_GPU_SERVICE_H_ |
6 #define SERVICES_UI_GPU_GPU_SERVICE_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" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 return gpu_feature_info_; | 77 return gpu_feature_info_; |
78 } | 78 } |
79 | 79 |
80 void set_in_host_process(bool in_host_process) { | 80 void set_in_host_process(bool in_host_process) { |
81 in_host_process_ = in_host_process; | 81 in_host_process_ = in_host_process; |
82 } | 82 } |
83 | 83 |
84 void set_start_time(base::Time start_time) { start_time_ = start_time; } | 84 void set_start_time(base::Time start_time) { start_time_ = start_time; } |
85 | 85 |
86 const gpu::GPUInfo& gpu_info() const { return gpu_info_; } | 86 const gpu::GPUInfo& gpu_info() const { return gpu_info_; } |
87 void set_gpu_info(const gpu::GPUInfo& gpu_info) { gpu_info_ = gpu_info; } | |
88 | 87 |
89 private: | 88 private: |
90 friend class GpuMain; | 89 friend class GpuMain; |
91 | 90 |
92 void RecordLogMessage(int severity, | 91 void RecordLogMessage(int severity, |
93 size_t message_start, | 92 size_t message_start, |
94 const std::string& message); | 93 const std::string& message); |
95 | 94 |
96 gpu::SyncPointManager* sync_point_manager() { return sync_point_manager_; } | 95 gpu::SyncPointManager* sync_point_manager() { return sync_point_manager_; } |
97 | 96 |
98 gpu::gles2::MailboxManager* mailbox_manager() { | 97 gpu::gles2::MailboxManager* mailbox_manager() { |
99 return gpu_channel_manager_->mailbox_manager(); | 98 return gpu_channel_manager_->mailbox_manager(); |
100 } | 99 } |
101 | 100 |
102 gl::GLShareGroup* share_group() { | 101 gl::GLShareGroup* share_group() { |
103 return gpu_channel_manager_->share_group(); | 102 return gpu_channel_manager_->share_group(); |
104 } | 103 } |
105 | 104 |
| 105 void UpdateGpuInfoPlatform(); |
| 106 |
106 // gpu::GpuChannelManagerDelegate: | 107 // gpu::GpuChannelManagerDelegate: |
107 void DidCreateOffscreenContext(const GURL& active_url) override; | 108 void DidCreateOffscreenContext(const GURL& active_url) override; |
108 void DidDestroyChannel(int client_id) override; | 109 void DidDestroyChannel(int client_id) override; |
109 void DidDestroyOffscreenContext(const GURL& active_url) override; | 110 void DidDestroyOffscreenContext(const GURL& active_url) override; |
110 void DidLoseContext(bool offscreen, | 111 void DidLoseContext(bool offscreen, |
111 gpu::error::ContextLostReason reason, | 112 gpu::error::ContextLostReason reason, |
112 const GURL& active_url) override; | 113 const GURL& active_url) override; |
113 void StoreShaderToDisk(int client_id, | 114 void StoreShaderToDisk(int client_id, |
114 const std::string& key, | 115 const std::string& key, |
115 const std::string& shader) override; | 116 const std::string& shader) override; |
(...skipping 17 matching lines...) Expand all Loading... |
133 gfx::BufferFormat format, | 134 gfx::BufferFormat format, |
134 gfx::BufferUsage usage, | 135 gfx::BufferUsage usage, |
135 int client_id, | 136 int client_id, |
136 gpu::SurfaceHandle surface_handle, | 137 gpu::SurfaceHandle surface_handle, |
137 const CreateGpuMemoryBufferCallback& callback) override; | 138 const CreateGpuMemoryBufferCallback& callback) override; |
138 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 139 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
139 int client_id, | 140 int client_id, |
140 const gpu::SyncToken& sync_token) override; | 141 const gpu::SyncToken& sync_token) override; |
141 void GetVideoMemoryUsageStats( | 142 void GetVideoMemoryUsageStats( |
142 const GetVideoMemoryUsageStatsCallback& callback) override; | 143 const GetVideoMemoryUsageStatsCallback& callback) override; |
| 144 void RequestCompleteGpuInfo( |
| 145 const RequestCompleteGpuInfoCallback& callback) override; |
143 void LoadedShader(const std::string& data) override; | 146 void LoadedShader(const std::string& data) override; |
144 void DestroyingVideoSurface( | 147 void DestroyingVideoSurface( |
145 int32_t surface_id, | 148 int32_t surface_id, |
146 const DestroyingVideoSurfaceCallback& callback) override; | 149 const DestroyingVideoSurfaceCallback& callback) override; |
147 void WakeUpGpu() override; | 150 void WakeUpGpu() override; |
148 void DestroyAllChannels() override; | 151 void DestroyAllChannels() override; |
149 void Crash() override; | 152 void Crash() override; |
150 void Hang() override; | 153 void Hang() override; |
151 void ThrowJavaException() override; | 154 void ThrowJavaException() override; |
152 void Stop(const StopCallback& callback) override; | 155 void Stop(const StopCallback& callback) override; |
(...skipping 29 matching lines...) Expand all Loading... |
182 base::Time start_time_; | 185 base::Time start_time_; |
183 | 186 |
184 mojo::BindingSet<mojom::GpuService> bindings_; | 187 mojo::BindingSet<mojom::GpuService> bindings_; |
185 | 188 |
186 DISALLOW_COPY_AND_ASSIGN(GpuService); | 189 DISALLOW_COPY_AND_ASSIGN(GpuService); |
187 }; | 190 }; |
188 | 191 |
189 } // namespace ui | 192 } // namespace ui |
190 | 193 |
191 #endif // SERVICES_UI_GPU_GPU_SERVICE_H_ | 194 #endif // SERVICES_UI_GPU_GPU_SERVICE_H_ |
OLD | NEW |