chromium/cc/slim/frame_sink_impl.h

// 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_IMPL_H_
#define CC_SLIM_FRAME_SINK_IMPL_H_

#include <memory>
#include <optional>
#include <string>
#include <vector>

#include "base/component_export.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/platform_thread.h"
#include "cc/resources/ui_resource_bitmap.h"
#include "cc/resources/ui_resource_client.h"
#include "cc/slim/frame_sink.h"
#include "cc/slim/scheduler.h"
#include "components/viz/client/client_resource_provider.h"
#include "components/viz/common/frame_sinks/begin_frame_args.h"
#include "components/viz/common/frame_timing_details_map.h"
#include "components/viz/common/gpu/context_lost_observer.h"
#include "components/viz/common/gpu/raster_context_provider.h"
#include "components/viz/common/hit_test/hit_test_region_list.h"
#include "components/viz/common/surfaces/local_surface_id.h"
#include "gpu/command_buffer/common/sync_token.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/cpp/bindings/pending_associated_remote.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "services/viz/public/mojom/compositing/compositor_frame_sink.mojom.h"

namespace gpu {
class ClientSharedImage;
}

namespace cc::slim {

class FrameSinkImplClient;
class Scheduler;
class TestFrameSinkImpl;

// Slim implementation of FrameSink.
// * Owns mojo interfaces to viz and responsible for submitting frames and
//   issuing BeginFrame to client.
// * Owns context provider.
// * Listen and respond to context loss or GPU process crashes.
// * Manage uploading UIResource.
class COMPONENT_EXPORT(CC_SLIM) FrameSinkImpl
    : public FrameSink,
      public SchedulerClient,
      public viz::ContextLostObserver,
      public viz::mojom::CompositorFrameSinkClient {};

}  // namespace cc::slim

#endif  // CC_SLIM_FRAME_SINK_IMPL_H_