Avi Drissman | 4e1b7bc3 | 2022-09-15 14:03:50 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors |
Ken Rockot | 6d9ed9503 | 2019-11-13 17:20:47 | [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 | |
| 5 | #include "content/gpu/browser_exposed_gpu_interfaces.h" |
| 6 | |
kylechar | 3da52ff9 | 2022-11-08 14:08:57 | [diff] [blame] | 7 | #include "build/build_config.h" |
Ken Rockot | 6d9ed9503 | 2019-11-13 17:20:47 | [diff] [blame] | 8 | #include "content/public/common/content_client.h" |
| 9 | #include "content/public/gpu/content_gpu_client.h" |
| 10 | #include "mojo/public/cpp/bindings/binder_map.h" |
| 11 | |
kylechar | 3da52ff9 | 2022-11-08 14:08:57 | [diff] [blame] | 12 | #if BUILDFLAG(IS_OZONE) |
Ken Rockot | 6d9ed9503 | 2019-11-13 17:20:47 | [diff] [blame] | 13 | #include "ui/ozone/public/ozone_platform.h" |
| 14 | #endif |
| 15 | |
| 16 | namespace content { |
| 17 | |
Chunbo Hua | d90bffb2 | 2020-09-28 15:34:36 | [diff] [blame] | 18 | void ExposeGpuInterfacesToBrowser( |
| 19 | const gpu::GpuPreferences& gpu_preferences, |
| 20 | const gpu::GpuDriverBugWorkarounds& gpu_workarounds, |
| 21 | mojo::BinderMap* binders) { |
Ken Rockot | 6d9ed9503 | 2019-11-13 17:20:47 | [diff] [blame] | 22 | if (GetContentClient()->gpu()) { // May be null in tests. |
Chunbo Hua | d90bffb2 | 2020-09-28 15:34:36 | [diff] [blame] | 23 | GetContentClient()->gpu()->ExposeInterfacesToBrowser( |
| 24 | gpu_preferences, gpu_workarounds, binders); |
Ken Rockot | 6d9ed9503 | 2019-11-13 17:20:47 | [diff] [blame] | 25 | } |
| 26 | |
kylechar | 3da52ff9 | 2022-11-08 14:08:57 | [diff] [blame] | 27 | #if BUILDFLAG(IS_OZONE) |
Maksim Sisov | 2ac2c31 | 2021-11-03 08:00:12 | [diff] [blame] | 28 | ui::OzonePlatform::GetInstance()->AddInterfaces(binders); |
Ken Rockot | 6d9ed9503 | 2019-11-13 17:20:47 | [diff] [blame] | 29 | #endif |
| 30 | } |
| 31 | |
| 32 | } // namespace content |