#include "cc/test/test_layer_tree_frame_sink.h"
#include <stdint.h>
#include <memory>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/task/single_thread_task_runner.h"
#include "cc/trees/layer_tree_frame_sink_client.h"
#include "cc/trees/single_thread_proxy.h"
#include "cc/trees/task_runner_provider.h"
#include "components/viz/common/features.h"
#include "components/viz/common/frame_sinks/begin_frame_args.h"
#include "components/viz/common/resources/bitmap_allocation.h"
#include "components/viz/service/display/direct_renderer.h"
#include "components/viz/service/display/output_surface.h"
#include "components/viz/service/display/overlay_processor_stub.h"
#include "components/viz/service/display/skia_output_surface.h"
#include "components/viz/service/frame_sinks/compositor_frame_sink_support.h"
#include "gpu/ipc/client/client_shared_image_interface.h"
#include "mojo/public/cpp/system/platform_handle.h"
namespace cc {
static constexpr viz::FrameSinkId kLayerTreeFrameSinkId(1, 1);
TestLayerTreeFrameSink::TestLayerTreeFrameSink(
scoped_refptr<viz::RasterContextProvider> compositor_context_provider,
scoped_refptr<viz::RasterContextProvider> worker_context_provider,
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
const viz::RendererSettings& renderer_settings,
const viz::DebugRendererSettings* const debug_settings,
TaskRunnerProvider* task_runner_provider,
bool synchronous_composite,
bool disable_display_vsync,
double refresh_rate,
viz::BeginFrameSource* begin_frame_source)
: … { … }
TestLayerTreeFrameSink::~TestLayerTreeFrameSink() = default;
void TestLayerTreeFrameSink::SetDisplayColorSpace(
const gfx::ColorSpace& display_color_space) { … }
bool TestLayerTreeFrameSink::BindToClient(LayerTreeFrameSinkClient* client) { … }
void TestLayerTreeFrameSink::UnregisterBeginFrameSource() { … }
void TestLayerTreeFrameSink::DetachFromClient() { … }
void TestLayerTreeFrameSink::SetLocalSurfaceId(
const viz::LocalSurfaceId& local_surface_id) { … }
void TestLayerTreeFrameSink::SubmitCompositorFrame(viz::CompositorFrame frame,
bool hit_test_data_changed) { … }
void TestLayerTreeFrameSink::DidNotProduceFrame(const viz::BeginFrameAck& ack,
FrameSkippedReason reason) { … }
void TestLayerTreeFrameSink::DidAllocateSharedBitmap(
base::ReadOnlySharedMemoryRegion region,
const viz::SharedBitmapId& id) { … }
void TestLayerTreeFrameSink::DidDeleteSharedBitmap(
const viz::SharedBitmapId& id) { … }
void TestLayerTreeFrameSink::DidReceiveCompositorFrameAck(
std::vector<viz::ReturnedResource> resources) { … }
void TestLayerTreeFrameSink::OnBeginFrame(
const viz::BeginFrameArgs& args,
const viz::FrameTimingDetailsMap& timing_details,
bool frame_ack,
std::vector<viz::ReturnedResource> resources) { … }
void TestLayerTreeFrameSink::ReclaimResources(
std::vector<viz::ReturnedResource> resources) { … }
void TestLayerTreeFrameSink::OnBeginFramePausedChanged(bool paused) { … }
void TestLayerTreeFrameSink::DisplayOutputSurfaceLost() { … }
void TestLayerTreeFrameSink::DisplayWillDrawAndSwap(
bool will_draw_and_swap,
viz::AggregatedRenderPassList* render_passes) { … }
void TestLayerTreeFrameSink::DisplayDidDrawAndSwap() { … }
void TestLayerTreeFrameSink::DisplayDidReceiveCALayerParams(
const gfx::CALayerParams& ca_layer_params) { … }
void TestLayerTreeFrameSink::DisplayDidCompleteSwapWithSize(
const gfx::Size& pixel_Size) { … }
void TestLayerTreeFrameSink::DisplayAddChildWindowToBrowser(
gpu::SurfaceHandle child_window) { … }
void TestLayerTreeFrameSink::OnNeedsBeginFrames(bool needs_begin_frames) { … }
void TestLayerTreeFrameSink::SendCompositorFrameAckToClient() { … }
base::TimeDelta TestLayerTreeFrameSink::GetPreferredFrameIntervalForFrameSinkId(
const viz::FrameSinkId& id,
viz::mojom::CompositorFrameSinkType* type) { … }
}