[go: nahoru, domu]

blob: 1d67b3f3e0784258b076da2ff2935f3e16b4170a [file] [log] [blame]
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_SLIM_FRAME_SINK_H_
#define CC_SLIM_FRAME_SINK_H_
#include <memory>
#include "base/component_export.h"
#include "base/memory/ref_counted.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/platform_thread.h"
#include "components/viz/common/gpu/context_provider.h"
#include "services/viz/public/mojom/compositing/compositor_frame_sink.mojom.h"
namespace gpu {
class GpuMemoryBufferManager;
}
namespace cc::slim {
// Abstraction and ownership over connections to the GPU process:
// `viz::mojom::CompositorFrameSink` and `viz::ContextProvider`.
// Client needs to create this when requested by `LayerTree`.
class COMPONENT_EXPORT(CC_SLIM) FrameSink {
public:
static std::unique_ptr<FrameSink> Create(
mojo::PendingAssociatedRemote<viz::mojom::CompositorFrameSink>
compositor_frame_sink_associated_remote,
mojo::PendingReceiver<viz::mojom::CompositorFrameSinkClient>
client_receiver,
scoped_refptr<viz::ContextProvider> context_provider,
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
// Parameters below only used when wrapping cc.
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
base::PlatformThreadId io_thread_id);
virtual ~FrameSink() = default;
};
} // namespace cc::slim
#endif // CC_SLIM_FRAME_SINK_H_