blob: 7fbb05e606fc26364c674c6330b8a5eb9c016fb3 [file] [log] [blame]
Avi Drissman8ba1bad2022-09-13 19:22:361// Copyright 2019 The Chromium Authors
Sunny Sachanandaniec6f13b2019-05-01 00:25:502// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_OUTPUT_SURFACE_PROVIDER_H_
6#define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_OUTPUT_SURFACE_PROVIDER_H_
7
8#include <memory>
9
Weiliang Chen8bab2d6d32020-10-24 00:28:2410#include "components/viz/service/display/display_compositor_memory_and_task_controller.h"
Kevin Haslett927f2342022-08-02 20:10:5811#include "gpu/command_buffer/service/gpu_task_scheduler_helper.h"
Sunny Sachanandaniec6f13b2019-05-01 00:25:5012#include "gpu/ipc/common/surface_handle.h"
Miyoung Shin2be27f52019-07-27 15:35:3913#include "services/viz/privileged/mojom/compositing/display_private.mojom.h"
Sunny Sachanandaniec6f13b2019-05-01 00:25:5014
Maggie Chen0b4389c2024-08-07 21:25:0515namespace gpu {
16class Scheduler;
17} // namespace gpu
18
Sunny Sachanandaniec6f13b2019-05-01 00:25:5019namespace viz {
20
Alexander Alekseev81b01612020-07-10 22:56:2921struct DebugRendererSettings;
Weiliang Chen8bab2d6d32020-10-24 00:28:2422class DisplayCompositorMemoryAndTaskController;
Sunny Sachanandaniec6f13b2019-05-01 00:25:5023class RendererSettings;
24class OutputSurface;
25
26// Handles creating OutputSurface for FrameSinkManagerImpl.
27class OutputSurfaceProvider {
28 public:
Sorin Jianu58421902024-10-10 21:33:4529 virtual ~OutputSurfaceProvider() = default;
Sunny Sachanandaniec6f13b2019-05-01 00:25:5030
Weiliang Chenb26e8e02020-10-02 19:29:5531 // Needs to be called before calling the CreateOutputSurface function. Output
32 // of this should feed into the CreateOutputSurface function.
Weiliang Chen8bab2d6d32020-10-24 00:28:2433 virtual std::unique_ptr<DisplayCompositorMemoryAndTaskController>
34 CreateGpuDependency(bool gpu_compositing,
kylechar18a2fff2022-06-01 19:19:2835 gpu::SurfaceHandle surface_handle) = 0;
Weiliang Chenb26e8e02020-10-02 19:29:5536
Sunny Sachanandaniec6f13b2019-05-01 00:25:5037 // Creates a new OutputSurface for |surface_handle|. If creating an
38 // OutputSurface fails this function will return null.
39 virtual std::unique_ptr<OutputSurface> CreateOutputSurface(
40 gpu::SurfaceHandle surface_handle,
41 bool gpu_compositing,
42 mojom::DisplayClient* display_client,
Weiliang Chen8bab2d6d32020-10-24 00:28:2443 DisplayCompositorMemoryAndTaskController* gpu_dependency,
Alexander Alekseev81b01612020-07-10 22:56:2944 const RendererSettings& renderer_settings,
45 const DebugRendererSettings* debug_settings) = 0;
Maggie Chen177e3a02023-11-15 02:13:0346
47 virtual gpu::SharedImageManager* GetSharedImageManager() = 0;
Maggie Chen1b8741902023-11-30 21:35:4248 virtual gpu::SyncPointManager* GetSyncPointManager() = 0;
Maggie Chen0b4389c2024-08-07 21:25:0549 virtual gpu::Scheduler* GetGpuScheduler() = 0;
Sunny Sachanandaniec6f13b2019-05-01 00:25:5050};
51
52} // namespace viz
53
Maggie Chen0b4389c2024-08-07 21:25:0554#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_OUTPUT_SURFACE_PROVIDER_H_