blob: 428dc7369c9eed220a7f53f2b087f04114e8f8c4 [file] [log] [blame]
Avi Drissman05dfbc822022-09-13 21:25:341// Copyright 2014 The Chromium Authors
[email protected]0971f242014-07-30 05:37:182// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
primiano05dadf012015-01-28 13:10:325#include "base/trace_event/trace_event.h"
Zhenyao Mo17d81d82019-12-20 22:30:066#include "build/build_config.h"
7#include "build/chromecast_buildflags.h"
[email protected]0971f242014-07-30 05:37:188#include "gpu/config/gpu_info_collector.h"
cwallez873b27d2017-03-16 14:55:149#include "third_party/angle/src/gpu_info_util/SystemInfo.h"
Jonah Ryan-Davisb0d87642022-08-09 22:38:2010#include "ui/gl/gl_display.h"
11#include "ui/gl/gl_utils.h"
[email protected]0971f242014-07-30 05:37:1812
13namespace gpu {
14
Jonah Ryan-Davis1775f61e2023-10-06 22:37:3415bool CollectContextGraphicsInfo(GPUInfo* gpu_info) {
[email protected]0971f242014-07-30 05:37:1816 DCHECK(gpu_info);
17
18 TRACE_EVENT0("gpu", "gpu_info_collector::CollectGraphicsInfo");
19
Ryan Keane2a3aa8e92022-06-09 18:51:3220#if BUILDFLAG(IS_CASTOS)
Zhenyao Mo17d81d82019-12-20 22:30:0621 // 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 Keane2a3aa8e92022-06-09 18:51:3225#endif // BUILDFLAG(IS_CASTOS)
Zhenyao Mo17d81d82019-12-20 22:30:0626
Jonah Ryan-Davis1775f61e2023-10-06 22:37:3427 return CollectGraphicsInfoGL(gpu_info, gl::GetDefaultDisplay());
[email protected]0971f242014-07-30 05:37:1828}
29
Zhenyao Mo9307be372018-02-23 00:23:0130bool CollectBasicGraphicsInfo(GPUInfo* gpu_info) {
[email protected]0971f242014-07-30 05:37:1831 DCHECK(gpu_info);
32
cwallez873b27d2017-03-16 14:55:1433 angle::SystemInfo system_info;
Corentin Wallez2257d922017-10-16 18:00:0534 bool success = angle::GetSystemInfo(&system_info);
35 FillGPUInfoFromSystemInfo(gpu_info, &system_info);
Zhenyao Mo9307be372018-02-23 00:23:0136 return success;
[email protected]0971f242014-07-30 05:37:1837}
38
[email protected]0971f242014-07-30 05:37:1839} // namespace gpu