blob: 96d3918fb58a7ced2bda9a53ea706f75707c426c [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
7#include "content/public/common/content_client.h"
8#include "content/public/gpu/content_gpu_client.h"
9#include "mojo/public/cpp/bindings/binder_map.h"
10
11#if defined(USE_OZONE)
12#include "ui/ozone/public/ozone_platform.h"
13#endif
14
15namespace content {
16
Chunbo Huad90bffb22020-09-28 15:34:3617void ExposeGpuInterfacesToBrowser(
18 const gpu::GpuPreferences& gpu_preferences,
19 const gpu::GpuDriverBugWorkarounds& gpu_workarounds,
20 mojo::BinderMap* binders) {
Ken Rockot6d9ed95032019-11-13 17:20:4721 if (GetContentClient()->gpu()) { // May be null in tests.
Chunbo Huad90bffb22020-09-28 15:34:3622 GetContentClient()->gpu()->ExposeInterfacesToBrowser(
23 gpu_preferences, gpu_workarounds, binders);
Ken Rockot6d9ed95032019-11-13 17:20:4724 }
25
26#if defined(USE_OZONE)
Maksim Sisov2ac2c312021-11-03 08:00:1227 ui::OzonePlatform::GetInstance()->AddInterfaces(binders);
Ken Rockot6d9ed95032019-11-13 17:20:4728#endif
29}
30
31} // namespace content