blob: 20856f9e95b31a17012818ca79e89ea7a0d2539c [file] [log] [blame]
Avi Drissman4e1b7bc32022-09-15 14:03:501// Copyright 2019 The Chromium Authors
Ken Rockot6d9ed95032019-11-13 17:20:472// 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
kylechar3da52ff92022-11-08 14:08:577#include "build/build_config.h"
Ken Rockot6d9ed95032019-11-13 17:20:478#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
kylechar3da52ff92022-11-08 14:08:5712#if BUILDFLAG(IS_OZONE)
Ken Rockot6d9ed95032019-11-13 17:20:4713#include "ui/ozone/public/ozone_platform.h"
14#endif
15
16namespace content {
17
Chunbo Huad90bffb22020-09-28 15:34:3618void ExposeGpuInterfacesToBrowser(
Colin Blundell8b1809e2025-07-09 08:01:1119 viz::GpuServiceImpl* gpu_service,
Chunbo Huad90bffb22020-09-28 15:34:3620 const gpu::GpuPreferences& gpu_preferences,
21 const gpu::GpuDriverBugWorkarounds& gpu_workarounds,
22 mojo::BinderMap* binders) {
Ken Rockot6d9ed95032019-11-13 17:20:4723 if (GetContentClient()->gpu()) { // May be null in tests.
Chunbo Huad90bffb22020-09-28 15:34:3624 GetContentClient()->gpu()->ExposeInterfacesToBrowser(
Colin Blundell8b1809e2025-07-09 08:01:1125 gpu_service, gpu_preferences, gpu_workarounds, binders);
Ken Rockot6d9ed95032019-11-13 17:20:4726 }
27
kylechar3da52ff92022-11-08 14:08:5728#if BUILDFLAG(IS_OZONE)
Maksim Sisov2ac2c312021-11-03 08:00:1229 ui::OzonePlatform::GetInstance()->AddInterfaces(binders);
Ken Rockot6d9ed95032019-11-13 17:20:4730#endif
31}
32
33} // namespace content