Avi Drissman | 05dfbc82 | 2022-09-13 21:25:34 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors |
[email protected] | 0971f24 | 2014-07-30 05:37:18 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
primiano | 05dadf01 | 2015-01-28 13:10:32 | [diff] [blame] | 5 | #include "base/trace_event/trace_event.h" |
Zhenyao Mo | 17d81d8 | 2019-12-20 22:30:06 | [diff] [blame] | 6 | #include "build/build_config.h" |
7 | #include "build/chromecast_buildflags.h" | ||||
[email protected] | 0971f24 | 2014-07-30 05:37:18 | [diff] [blame] | 8 | #include "gpu/config/gpu_info_collector.h" |
cwallez | 873b27d | 2017-03-16 14:55:14 | [diff] [blame] | 9 | #include "third_party/angle/src/gpu_info_util/SystemInfo.h" |
Jonah Ryan-Davis | b0d8764 | 2022-08-09 22:38:20 | [diff] [blame] | 10 | #include "ui/gl/gl_display.h" |
11 | #include "ui/gl/gl_utils.h" | ||||
[email protected] | 0971f24 | 2014-07-30 05:37:18 | [diff] [blame] | 12 | |
13 | namespace gpu { | ||||
14 | |||||
Jonah Ryan-Davis | 1775f61e | 2023-10-06 22:37:34 | [diff] [blame] | 15 | bool CollectContextGraphicsInfo(GPUInfo* gpu_info) { |
[email protected] | 0971f24 | 2014-07-30 05:37:18 | [diff] [blame] | 16 | DCHECK(gpu_info); |
17 | |||||
18 | TRACE_EVENT0("gpu", "gpu_info_collector::CollectGraphicsInfo"); | ||||
19 | |||||
Ryan Keane | 2a3aa8e9 | 2022-06-09 18:51:32 | [diff] [blame] | 20 | #if BUILDFLAG(IS_CASTOS) |
Zhenyao Mo | 17d81d8 | 2019-12-20 22:30:06 | [diff] [blame] | 21 | // Chromecast doesn't go through CollectBasicGraphicsInfo() step, so |
22 | // this is the only place we need to set machine model. | ||||
23 | // TODO(zmo): maybe distinguish different Chromecast products. | ||||
24 | gpu_info->machine_model_name = "Chromecast"; | ||||
Ryan Keane | 2a3aa8e9 | 2022-06-09 18:51:32 | [diff] [blame] | 25 | #endif // BUILDFLAG(IS_CASTOS) |
Zhenyao Mo | 17d81d8 | 2019-12-20 22:30:06 | [diff] [blame] | 26 | |
Jonah Ryan-Davis | 1775f61e | 2023-10-06 22:37:34 | [diff] [blame] | 27 | return CollectGraphicsInfoGL(gpu_info, gl::GetDefaultDisplay()); |
[email protected] | 0971f24 | 2014-07-30 05:37:18 | [diff] [blame] | 28 | } |
29 | |||||
Zhenyao Mo | 9307be37 | 2018-02-23 00:23:01 | [diff] [blame] | 30 | bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) { |
[email protected] | 0971f24 | 2014-07-30 05:37:18 | [diff] [blame] | 31 | DCHECK(gpu_info); |
32 | |||||
cwallez | 873b27d | 2017-03-16 14:55:14 | [diff] [blame] | 33 | angle::SystemInfo system_info; |
Corentin Wallez | 2257d92 | 2017-10-16 18:00:05 | [diff] [blame] | 34 | bool success = angle::GetSystemInfo(&system_info); |
35 | FillGPUInfoFromSystemInfo(gpu_info, &system_info); | ||||
Zhenyao Mo | 9307be37 | 2018-02-23 00:23:01 | [diff] [blame] | 36 | return success; |
[email protected] | 0971f24 | 2014-07-30 05:37:18 | [diff] [blame] | 37 | } |
38 | |||||
[email protected] | 0971f24 | 2014-07-30 05:37:18 | [diff] [blame] | 39 | } // namespace gpu |